Malaga were knocked off the top of the Segunda table for the first time since August after suffering a 2-1 reversal against Osasuna at El Sadar on Saturday.
Despite a relatively tranquil first half in which Pau Torres gave Malaga the lead, the game was turned on its head in the 75th minute when Gustavo Blanco Leschuk received a second yellow card, a "clear turning point" for Malaga coach Juan Ramón Muñiz.
"It's a shame because we had the game under control. Until the sending off, our players followed the game plan perfectly."
Muñiz's side went ahead in the 21st minute when defender Pau slid to connect with Dani Pacheco's free kick from the left.
But despite the setback of losing Juanpi to injury, Malaga almost had a second goal courtesy of Mamadou Koné. The Senegalese forward, again deputising for Jack Harper whose injury has turned out to be worse than first thought, turned the defender on the corner of the penalty area with some quick footwork before chipping his effort over the keeper but wide of the far post.
The start of the second half continued in much the same vein with the visitors managing the game, albeit not creating many chances.
A chance fell to Osasuna striker Juan Villar when a long ball over the top bounced nicely in the penalty area but the striker hit his shot straight at Munir who fumbled the ball into the air, fortunate that there was no one following in.
However, the tide would truly turn just five minutes later when Blanco Leschuk received a surprise second yellow for a high arm when challenging for an aerial dual just inside his own half.
Out of options
Malaga, by this point with only substitute Héctor up top, were now struggling to get out of their own half with Muñiz already having gone to a back five when he brought on centre-back David Lombán for Pacheco.
The equaliser didn't take long to arrive; in the 80th minute Juan Villar shrugged off the attentions of Luis Hernández before heading home Rubén García's free kick from close to the corner flag.
This setback, though, cost Malaga in more than one way: it cost them another man, this time Alfred N'Diaye.
Celebrations ended before they could begin as a fracas broke out among the players and resulted in both N'Diaye and Xisco also being sent off.
Things went from bad to worse for Malaga three minutes later when Roberto Torres scored a spectacular free kick from 25 yards out, getting the ball up and over the wall and into the top corner, rounding off a whirlwind ten-minute turnaround for the hosts.
Nine-man Malaga endeavoured to find the equaliser but struggled to get enough men forward. They did, however, manage to create one last chance deep into five minutes of stoppage time when Luis Hernández's long throw fell to Héctor whose close-range volley was deflected away off the defender's knee.