Malaga beat Espanyol 2-1 to switch places with the Catalan side and move a point ahead of them into sixth in La Liga on Sunday.
Espanyol were unfortunate to concede a decisive penalty on 73 minutes of a tight game that was level at that point at 1-1.
A thunderous drive seemed to hit Espanyol's midfielder Koffi Romaric in the face but referee Carlos Delgado awarded the home team a spot-kick that Antonio Galdeano 'Apono' converted to give Malaga victory.
Romaric left the pitch substituted minutes later with what appeared to be a swollen eye from the impact of the shot.
In the first period Jose Rondon had opened the scoring for Malaga after five minutes only for Alvaro Vazquez to equalise for the Barcelona side on the stroke of half-time. Earlier on Sunday Levante finally lost their first game of the season 2-0 away to Osasuna.
The result keeps Real Madrid top of La Liga a point ahead of Barcelona in second.
First-half goals from Juan Martinez 'Nino' and Alvaro Cejudo were enough to deny Levante an eighth straight league victory.
Real Madrid moved top on Saturday thanks to a 1-0 away win at Real Sociedad with Gonzalo Higuain scoring the winner for his 10th league goal of the season.
Lionel Messi starred for unbeaten Barcelona scoring a first-half hat-trick in a 5-0 thumping of Mallorca.
Levante remain third, two points behind Madrid after the defeat in Pamplona, their first in ten games.
An amazing run of seven straight wins, starting with a 1-0 defeat over Madrid in mid-September, had taken the small Valencia-based side to the top of the league.
However, they were no match for a hungry Osasuna side that always looked a likely winner, despite playing with only ten men for more than thirty minutes.
Cejudo opened the scoring on 39 minutes for Osasuna with a left foot shot and celebrated by removing his shirt for an obligatory yellow card which he was later to regret.
'Nino' took advantage of a hesitant Levante defence five minutes later to give Osasuna a two goal advantage and the home team seemed home and dry.
However, when Cejudo received a second yellow for a reckless challenge on 58 minutes he left his team to defend the lead a man short.
Osasuna are now unbeaten in four games and move into eighth.
In other games Atletico Madrid beat Zaragoza 3-1 on Sunday to ease the pressure on much maligned coach Gregorio Manzano.
Two goals from Adrian Lopez and one from Alvaro Dominguez gave 'Los Colchoneros' their first win in eight matches, but did not stop the home fans from calling for the head of Manzano.
The win lifts Atletico to ninth but leaves Zaragoza, for whom the Portuguese Hector Postiga grabbed a consolation on 78 minutes, still struggling in 15th.
Sporting Gijon salvaged a point in a 1-1 home draw with Athletic Bilbao which allowed the hosts to continue their slow but steady crawl out of the relegation zone.
Markel Susaeta opened the scoring for Bilbao on 63 minutes, finishing from close range after a corner was flicked on at the near post by Gaizka Toquero.
Gijon substitute Mate Bilic equalised eight minutes later with a thunderbolt drive from 25 yards which made sure the hosts avoided what would have been their seventh defeat in 10 games.
Having plummeted to the bottom of the Primera Liga at the start of the season, Gijon have now picked up seven points from a possible nine, while Bilbao - unbeaten in eight games - move up to seventh.
Racing Santander beat Real Betis 1-0 to chalk up their first win of the season, the last team in the league to win a game.
Victory came with a second-half penalty converted by Christian Stuauni but Racing remain in a relegation place.
Also on Saturday Valencia beat Getafe 3-1 to remain in fourth, four points off the pace, as they prepare to host Bayer Leverkusen on Tuesday in a must-win Champions League clash.
Villarreal warmed up for their Champions League tie at home to Manchester City on Wednesday by beating Rayo Vallecano 2-0.