(CNN) -- Real Madrid came from two goals down to beat Sevilla 3-2 in Spain's La Liga and claim top spot in the standings ahead of arch-rivals and reigning champions Barcelona.
After 10-man Barcelona were held 2-2 by Almeria, Real had the chance to go ahead on goal difference, but left it late at the Bernabeu.
They went two goals down behind through an own-goal from midfielder Xabi Alonso and an Ivica Dragutinovic free-kick that deceived Real goalkeeper Iker Casillas.
But Real hit right back with goals from world record signing Cristiano Ronaldo and full-back Sergio Ramos, who also scored for Spain in midweek against France.
With time running out, Sevilla looked to be holding out for a draw until Dutch star Rafael Van der Vaart shot home from close range.
Earlier, Barcelona surrendered vital points and had striker Zlatan Ibrahimovic shown a red card and coach Pep Guardiola sent to the stands.
Almeria took the lead against the run of play the 12th minute when Fernando Soriano's corner was met by Domingo Cisma who outmuscled Carles Puyol and headed the ball past Victor Valdes.
Barca drew level in the 42nd minute after they were awarded a disputed free-kick on the edge of penalty area after Ibrahimovic and Hernan Bernardello tumbled over.
Lionel Messi capitalized on the chance and chipped the ball over the wall and into the corner of the net with Almeria goalkeeper Diego Alves caught flat-footed.
Almeria went ahead for a second time in the game when Puyol put through his own net in the 57th after he diverted a cross from Brazilian Guilherme past Valdes before Ibrahimovic was sent off on the hour mark for a needless foul on Cisma.
Messi had a chance to equalize for a second time in the 64th minute when he lined up a free kick in an almost identical position to the one from which he scored in the first half, but this time it flew off target.
The Argentina playmaker took his chance moments later when Pedro crossed the ball into the box and Guilherme's poor header came to the feet of Messi who turned the ball home from close range.
Deportivo La Coruna boosted their hopes of a return to European competition as they came from behind to eventually claim a comfortable 3-1 home win over struggling Tenerife.
The visitors had taken a surprise lead in the 17th minute when Juanlu Hens latched on to a pass from Pablo Sicilia in the area and fired a low shot through the legs of Alberto Lopo and past Depor goalkeeper Daniel Aranzubia.
Miguel Angel Lotina's side leveled 15th minutes later when Juan Rodriguez headed Andres Guardado's cross past Sergio Aragoneses.
Deportivo took control after the half-time break when Guardado put them ahead with a brilliant left-footed drive in the 55th minute and Diego Colotto wrapped up the points when he rifled in a low shot on the edge of the box after Tenerife again failed to clear a set-piece.