Cristiano Ronaldo's deflected shot in the fourth minute of stoppage time snatched a dramatic 3-2 La Liga victory for a below-par Real Madrid at lowly Levante on Saturday.
Real are flying in Europe after resounding Champions League victories over Galatasaray and FC Copenhagen but turned in another disappointing domestic performance following last weekend's 1-0 defeat at home to Atletico Madrid.
They twice had to come from behind at Levante's Ciutat de Valencia stadium before Ronaldo rifled a shot from the corner of the area and it glanced off a defender before ricocheting into the net off a post.
It was desperately hard on a plucky Levante side and their fans but moved Real back above Villarreal into third place.
Levante, whose entire squad are worth just over a third of the record $136 million Real paid for Wales winger Gareth Bale in the close season, took the lead in the 57th minute when Papa Babacar Diawara finished off a superb counter attack.
The goal appeared to wake the Real players from their lethargy and Sergio Ramos levelled four minutes later when he volleyed home an Angel Di Maria corner.
Levante rallied and substitute Nabil El Zhar fired through a crowd of defenders into the net in the 86th minute to put the home side within touching distance of an unlikely victory.
There was still time for plenty more drama and Real substitute Alvaro Morata levelled when he blasted the ball in
from close range in the 90th minute.
Ronaldo, who ripped off his shirt after scoring the winner, now has seven goals in the league this season.
Real Sociedad lost their second game this week in agonising fashion, when Rayo Vallecano substitute Jonathan Viera earned and converted an 89th-minute penalty in the Spanish league.
Sociedad had already fallen at Bayer Leverkusen to an injury-time free kick in the Champions League on Tuesday.
The Basque side had gone winless in their last nine games in all competitions.
Rayo's Adrian Gonzalez and Joaquin Larrivey both hit the woodwork in the first half. But Sociedad improved after the restart and appeared set to get a point until goalkeeper Claudio Bravo tripped Viera in the area.
Rayo's second win in eight rounds broke a six-game losing streak and lifted them out of last place.
Also, Elche forward Ferran 'Coro' Corominas scored two goals in a 2-1 win over Espanyol at home, earning the promoted side their second straight victory.
Elche outplayed Espanyol in the first half and went ahead in the 40th when Coro - a former Espanyol player - outmaneuvered defender Raul Rodriguez to control a flicked-on throw-in before firing by goalkeeper Kiko Casilla.
Espanyol refreshed their attack after halftime and substitute Thievy Bifouma capped a passing combination to level in the 66th.
But just when the visitors looked close to turning the score around, Coro used a quick dribble to get away from Rodriguez and grabbed his second goal in the 74th.