Cristiano Ronaldo scored deep in injury time to cap Real Madrid 's incredible 3-2 comeback win at Levante on Saturday, keeping his team in touch with the top of the Spanish league.

At 1-1, Levante's Nabil El Zhar grabbed what looked to be the winner in the 86th, but Madrid substitute Alvaro Morata stepped up to level in the 90th.

Still facing what would have been a costly draw, Ronaldo's last-gasp strike hit both a defender and the post before settling into the net to crush the hosts' hopes of taking a point.

The victory put Madrid back in third place, two points behind Barcelona and Atletico Madrid before they both play this round.

It also saved coach Carlo Ancelotti from even more pressure following the loss to Atletico last weekend. Although his team's lackluster performance through most of the game will likely earn him more criticism.

Elsewhere, Real Sociedad lost its second game this week in agonizing fashion, when Rayo Vallecano substitute Jonathan Viera won and converted an 89th-minute penalty.

Elche, meanwhile, got its second straight victory thanks to forward Ferran ''Coro'' Corominas' two goals in a 2-1 win over visiting Espanyol.

Without the injured Gareth Bale, Madrid could do very little to disarm Levante's stingy defense in the first half at a Ciutat de Valencia Stadium where it had lost in two of its previous three visits.

Since suffering a 7-0 thrashing at Barcelona in the league opener, new coach Joaquin Caparros - known for his focus on defense - had steered Levante to a six-game undefeated streak that it almost kept going considering it never trailed Madrid until stoppage time.

After a foul-ridden first 45 minutes, Levante opened through striker Babacar ''Baba'' Diawara in the 57th.

Madrid was caught pressing forward when Levante got a three-on-two breakaway, and midfielder Jordi Xumetra floated a cross for Baba to beat goalkeeper Diego Lopez with a right-footed volley.

Sergio Ramos leveled four minutes later when the Madrid center back raced in at the second post and slammed in Angel Di Maria's corner kick.

Ramos was denied a possible second goal in the 65th when his header hit teammate Karim Benzema in the six-yard box.

Madrid was again caught looking to score late when El Zhar did well to fend off Ramos in the area before he spun and fired the ball into the corner.

But Morata, who scored a late winner for Madrid here last season, coolly drove in his goal before Ronaldo pulled out his late heroics.