Lionel Messi scored a last-minute penalty as Barcelona defeated Espanyol, 2-1, in an incident-filled derby match that contained crowd trouble, two controversial goals and a sending off.
Under-fire striker Thierry Henry equalised late on for Barcelona before Messi converted a penalty with virtually the last kick of the game to keep Barca three points behind leaders Villarreal.
With ten-men Espanyol leading, 1-0, referee Luis Medina temporarily stopped the match in the 69th minute after fans threw flares at the celebrating Espanyol fans.
The players were called off but play then resumed seven minutes later and Henry equalised four minutes after the restart.
Espanyol had taken the lead under controversial circumstances on 19 minutes with Ferran Coro firing home after Luis Garcia appeared to foul Barca's goalkeeper Victor Valdes, causing him to drop the ball.
With Espanyol down to ten after Nene was sent off for a stray elbow, Messi struck the winner in the final derby match at Espanyol's Montjuic stadium.
Barcelona is third, three points behind new league leaders Villarreal and go into Wednesday's Champions League match at Shakhtar Donetsk in high spirits.
Villarreal lead the standings after a hard-earned 1-0 win over Sporting Gijon as they collected 13 points from a possible 15.
Valencia can reclaim top spot with victory over Deportivo La Coruna on Sunday.
Manager Manuel Pellegrini's side will enter Tuesday's Champions League home match against Celtic full of confidence.
"In football you can't talk about justice but good decisions and we had that and Sporting didn't," Pellegrini said. "At the end of the day it is these things that win you games."
Real Madrid sit a point behind Villarreal and two ahead of foes Barcelona after a difficult 2-1 win at Real Betis.
Down to ten men Real needed a stoppage time winner from Dutch striker Ruud van Nistelrooy to record their fourth successive league win.
"I think we deserved to win as we were superior especially in the first half when we had various opportunities apart from the goal," Real coach Bernd Schuster said.
"I always have faith that this team can win in the face of adversity and at the most difficult time in the match - when we had a man sent off and gave away a penalty - they knew exactly what to do."
Spanish international Sergio Garcia repaid Betis a chunk of his 10 million-euro transfer fee with his first goal to cancel out Gabriel Heinze's opener but van Nistelrooy had the final say in the dying seconds.
Real had been reduced to ten men on 54 minutes when Brazilian Marcelo conceded a penalty and got a straight red card for his foul.
Spanish international Garcia, later sent off for a second booking, saw his spot-kick saved by international teammate Iker Casillas but hammered home the rebound.
Betis had chances to take all three points but van Nistelrooy pounced on a chance in added time to break Betis hearts.
Real will pack their winter wear for the cold trip to Russia to face UEFA Cup holders Zenit St Petersburg for Tuesday's Champions League group match.
On Sunday Atletico Madrid host Sevilla at the Vicente Calderon in the first big game of the new season.
Sevilla coach Manolo Jimenez has been impressed by what he has seen of Atletico and said they were genuine title contenders.
"As far as I am concerned Atletico Madrid are contenders for everything," Jimenez said.