Leo Messi scored his 500th goal for FC Barcelona as his side beat Real Madrid 3-2 in the Santiago Bernabeu to go back to the top of the La Liga in Spain' s matchday 33.
Messi's goal decided a game which had alternatives, drama and controversy and in which both goalkeepers produced outstanding displays to keep the scores down.
Madrid took the lead through Casemiro, who was lucky not to be sent off, only for Messi to equalize before halftime.
Ivan Rakitic then put Barca ahead with 17 minutes remaining, but James Rodriguez equalized for a 10-man Madrid, who saw Sergio Ramos sent off for a dreadful challenge on Messi four minutes after James' goal.
The game looked to be heading for a draw, but Barca caught Madrid on the break in the last move of the game with Andres Gomes and Jordi Alba combining to set Messi up for the decisive goal.
Madrid still have a game in hand, but have gone from a situation where a win would have virtually given them the title to one where they now can't afford any slip ups in their five remaining matches if they want to win the league.
Atletico Madrid remain third after a 76th minute goal from Antoine Griezmann was enough to give them all three points against an Espanyol side that played well, but were denied at least a point by a series of fine saves from Atletico keeper Jan Oblak.
Villarreal assured they will remain fifth after a controversial 2-1 win at home to Leganes. The visitors thought they had taken a point when Miguel Angel Guerrero cancelled out Cedric Bakambu's 67th minute opener in the last minute of normal time, but Bakambu then netted his second in injury time, although TV replays showed he had punched the ball into the net and the goal should not have stood.
Real Sociedad moved into sixth place thanks to a 28th minute goal from Willian Jose, which gave them a 1-0 win at home to a Deportivo la Coruna side that did nothing to trouble the Basque side despite the apparently close score.
Sporting Gijon were unable to fully capitalize on Leganes' defeat, but moved a point closer to safety after a dramatic 2-2 draw away to Osasuna.
Osasuna had led 2-0 with 11 minutes left to play, but snatched a point thanks to goals from Roberto Canella and Carlos Castro.
Malaga kicked off Saturday with a well-deserved 2-0 win at home to Valencia, who looked as if they had travelled to the south coast to enjoy their holidays.
Recio opened the score with a 35th minute header before Sandro Ramirez sealed the win five minutes from half time with a deflected shot from 25 meters.
Betis are just a point from mathematically assuring their Primera Liga spot for next season with a 1-0 win away to Celta Vigo, who made sweeping changes following their qualification for the semi-finals of the Europa League.
Darko Brasanac's 54th minute header was the difference between the two sides in a game Betis probably deserved to win by more goals.
Meanwhile Las Palmas and Alaves drew a relatively meaningless game 1-1 with goals from Prince Boateng and Ibai Gomez.
The round of matches kicked off on Friday with Sevilla defeating Granada 2-0 to leave Tony Adams without a point in his first two games in charge.