Basirra Toure and Ode Fulutudilu's Malaga will compete in the Liga Segunda next season despite a 4-2 win over Rayo Vallecano on Sunday.
Going into their final game of the season, Antonio Contreras's side needed a win as well favourable results from other relegation candidates to secure their place in the Spanish top-flight.
However, Malaga was relegated on goal difference after being tied on 25 points with Sporting de Huelva, who bowed 2-1 at Espanyol.
Adriana Martin opened the scoring from the spot in the 31st minute but Oriana Altuve scored twice to put the visitors 2-1 up before the break.