Substitute Achille Webo scored the winner in injury time on Wednesday and Osasuna edged Atletic Bilbao 3-2 to move atop the Spanish league.
The Cameroon striker sent a rising shot past Daniel Aranzubia after the Bilbao keeper parried a chance by Valmiro Lopes.
The victory was Osasuna's fourth in five games and gave the club 18 points, moving it one past Getafe, two ahead of FC Barcelona and Celta Vigo and with three more than Real Madrid, Villarreal and Valencia.
Mallorca beat Celta 1-0, Villarreal won 3-2 at Real Betis, while Getafe was playing Real Sociedad and Valencia was hosting Sevilla.
In other ninth-round matches, Ronaldinho converted an 81st-minute penalty in his 100th appearance for FC Barcelona and Henrik Larsson added a goal to give the defending champion a 2-0 win over Malaga.
Defender Juanma Delgado scored on two headers and Canadian Julian De Guzman added another goal to help Deportivo La Coruna beat Real Madrid 3-1.
Carlos Gurpegi gave Bilbao the lead at Osasuna's El Sadar stadium in the 27th minute. Raul Garcia equalized for Osasuna from distance in the 44th and then sent in a cross for Serbia-Montenegro striker Savo Milosevic to head in in the 61st.
Bilbao tied the game in the 81st through an own-goal by defender Rafael Clavero only to be beaten just before the final whistle by Webo's late strike.
Bilbao's defeat extended its winless run to four games and left the Basque team in last place with five points.
Barcelona dominated Malaga at the Camp Nou, but struggled to beat former goalkeeper Francesc Arnau.
Barcelona finally made the breakthrough in the 81st minute, capitalizing on the penalty after midfielder Juan Rodriguez was adjudged to have tripped Ronaldinho.
Substitute Larsson, who had replaced Samuel Eto'o, sealed Barcelona's fourth win of the season in the 88th minute by curling the ball around Arnau.
Madrid, which was without four injured players - Zinedine Zidane, Ronaldo, Julio Baptista and Michel Salgado - and suspended Thomas Gravesen, remained without a victory at Riazor Stadium since 1991.
The defeat was Madrid's fourth of the season and second its in four days, following a 1-2 loss to Valencia on Sunday.
De Guzman gave Deportivo the lead in the 35th minute when he swept a low shot past goalkeeper Iker Casillas for his first goal since joining the club from Hannover.
Deportivo, winless in six games, scored again just before halftime when Juanma headed powerfully home from a cross by former Real foward Pedro Munitis.
David Beckham, who played following Madrid's successful appeal on Tuesday against his red card against Valencia, was replaced by Javier Balboa in the 53rd minute.
Munitis' corner provided Juanma with his second goal in the 84th minute, while captain Raul Gonzalez scored Madrid's consolation goal with a long shot two minutes later.
Celta missed its chance to take over the league lead with its loss to Mallorca.
Mallorca's Italian midfielder Cristiano Doni decided the game with a flicked goal from just inside the area in the 47th minute.
Celta's problems worsened seven minutes later when its Chilean defender Pablo Contreras was ejected for a second yellow card.
Mallorca's victory was its first in six games and eased the pressure on coach Hector Cuper, whose team was beaten 1-4 by third-division Alcoyano in the Copa del Rey last week.
Villarreal's victory over Betis to extended its unbeaten run to five games and moved it into sixth.
Betis is 14th with nine points.