(CNN) -- Cristiano Ronaldo scored a late penalty to give 10-man Real Madrid a 1-1 draw in the second "El Clasico" of the Spanish season on Saturday that left Barcelona on course for a third successive La Liga title.
Lionel Messi equaled the record of 49 goals in a Spanish season with a penalty six minutes after halftime, with Real defender Raul Albiol sent off for dragging down David Villa.
Real, thrashed 5-0 in the Catalan capital in November, fought back despite the numerical disadvantage and leveled with nine minutes to play after Marcelo was fouled by Barca fullback Daniel Alves.
The result left the visitors eight points clear at the top of the table with six games to play, ahead of Wednesday's Copa Del Rey final between the two teams in Valencia.
They will also meet in the semifinals of the European Champions League, with the first leg in Madrid on April 27 and the return on May 3.
"A draw at the Bernabeu is a good result and I am happy with how we played, although maybe we could have done better at 1-0," Barca coach Pep Guardiola told AFP after dropping his first points in six league games against Real since taking over the role in 2008.
"I don't think we are league champions (yet) as we have to play against teams that are still fighting for their lives."
Jose Mourinho, wary of a repeat of his worst defeat as a club coach, started with a defensive line-up as Pepe was pushed forward into a three-man midfield alongside Xavi Alonso and Sami Khedira to combat Barcelona's attacking potency.
Villa appealed in vain for a penalty in the 26th minute after going down under the challenge of goalkeeper Iker Casillas, and it was Real who went closest to scoring first as defender Adriano had to clear Ronaldo's header from a corner off the line just before halftime.
The Portugal forward hit the base of Victor Valdes' post with a dipping freekick five minutes after the interval, but Real went behind straight away when Albiol hauled down Villa in the box after first appearing to handle the ball.
Messi stepped up to score his first goal against one of Mourinho's teams and match the mark set by legendary Hungarian Ferenc Puskas in the 1959-60 season -- his 30th league goal in just 29 games.
Mourinho shuffled his cards by bringing on attacking midfielder Mesut Ozil for striker Karim Benzema, and Barca lost captain Carles Puyol to a hamstring injury before Xavi shaved the top of Casillas' bar with a swirling shot.
The influential Puyol had returned after three months out with a knee injury, but is now in doubt for the remaining three Clasicos.
Real refused to give in, and the introduction of striker Emmanuel Adebayor helped spark a series of attacks that could have brought more reward than just Ronaldo's penalty after Alves brought down his fellow Brazilian.
He sent Valdes the wrong way for his 41st goal this season, 29 of them in La Liga, to set up a tense finish with even the usually calm Messi losing his cool.
Khedira had the chance to snatch an 89th-minute winner but the Germany international shot low at Valdes, and Barcelona held on in four minutes of time added on.
Valencia consolidated third place with a 3-0 win at bottom club Almeria earlier on Saturday, closing the gap on Real to 13 points.
Striker Roberto Soldado scored his seventh goal in three games, heading his 13th this season to open the scoring six minutes after halftime from Jeremy Mathieu's cross.
Lithuanian defender Marius Stankevicius doubled the lead from close range on 66, and midfielder Jordi Alba wrapped it up with a volley 10 minutes from time.
The win put Unai Emery's team nine points clear of fourth-placed Villarreal, who host third-bottom Real Zaragoza on Monday.
Fifth-placed Sevilla suffered a shock 1-0 defeat at Getafe, who moved four points away from the relegation zone after ending a run of nine league games without a win.
Venezuelan striker Miku scored the only goal with 14 minutes to play to give the Madrid-based team some breathing space.
Malaga moved out of the bottom three on goal difference above Zaragoza with a much-needed 3-0 victory at home to 10th-placed Mallorca.
Uruguayan striker Sebastian Fernandez opened the scoring in the 26th minute before Brazilian forward scored a goal in each half to boost coach Manuel Pellegrini, who at this stage last season was still in charge of Real Madrid.