Fernandez Gabi scored a 95th-minute penalty to earn struggling Real Zaragoza a precious 3-2 win that moves them off the bottom of the table on goal difference.
Goals from Pierre Webo and Michael Pereira, either side of Angel Lafita's strike, looked to have won it for European hopefuls Mallorca.
But Nicolas Bertolo equalised with five minutes to go, before Gabi struck from the spot to complete a stunning turnaround.
The Blanquillos started on a positive footing and Nobrega Braulio signalled their intentions with a fifth-minute drive that flew wide.
Their bright opening was quickly halted, though, as Webo gave Mallorca a 19th-minute lead when he ran on to Pereira's flick-on and lobbed the advancing Antonio Doblas from the edge of the area.
Zaragoza came back at Mallorca, with Carlos Diogo heading over from a corner and Lafita seeing a low strike blocked by Jose Carlos Nunes.
Pereira saw a volley blocked by Maurizio Lanzaro just before the break and Jonathan De Guzman could have scored from close range after the restart as Mallorca impressed.
But Zaragoza rode the storm and levelled the scores after 56 minutes when Lafita got in the box to get on the end of Braulio's assist.
They were unable to hold on to the lead for longer than five minutes, though, and Pereira and Webo combined again to give Mallorca the lead for a second time.
Webo's pass from the left was collected by Pereira who finished beyond Doblas, before Gabi thumped a drive against a post at the other end within two minutes.
Jiri Jarosik and Braulio also took aim for Zaragoza, while Marco Perez sent a header wide as they pressed for a second.
Their pressure told too, as Bertolo arrived in the box to volley home after a Braulio flick.
And just as the home fans had finished celebrating earning a point, Gabi's shot hit the hand of Jose Luis Marti in the box, and Gabi stepped up to ram home the penalty.