Karim Benzema opened the scoring in the 12th minute by converting a rebound after Marc-Andre ter Stegen saved from Vinicius Junior, with Fede Valverde drilling home the second from the edge of the box before the break.
Ferran Torres pulled one back for Barcelona in the final stages after good work by Ansu Fati, but Rodrygo won and converted a late penalty to ensure Carlo Ancelotti’s side inflicted Barcelona’s first domestic defeat of the season.
Madrid ended the Catalans’ seven-game winning streak in the league and added to the still-raw pain of their struggles in Europe, where they are on the verge of Champions League elimination.
Barcelona, who spent heavily in the summer to try and catch up with their rivals, now trail them by three points. The Catalans had conceded just one league goal in eight games before the Clasico but shipped double that tally in the first half, leaving Madrid as the division’s only unbeaten side.
“We knew there would come a time in the game where we had to suffer, because they move the ball well, and that’s when each of us had to give more, defend well, and we did it,” Madrid midfielder Luka Modric told DAZN.
In attack we were convincing, we scored three goals and I’m very happy for our performance, I think we had a great game.”
After a damaging draw with Inter Milan midweek that left Barcelona’s European hopes hanging by a thread, Xavi made changes, including Jules Kounde returning in place of Gerard Pique.
Last season Barcelona’s best moment came at the Bernabeu, as Xavi’s side earned a surprising 4-0 win, but this visit found them at their lowest ebb since the Spanish World Cup winner took charge.
“The feeling I have right now is that we’re in a negative dynamic where nothing is going for us,” Xavi told DAZN. “I can’t be happy with anything, losing in the Bernabeu 3-1 is very bad.
Vinicius probed in the opening stages down the left flank against the unconvincing Sergi Roberto and that was where Madrid’s opening goal came from after 12 minutes.
The masterful Toni Kroos held off Sergio Busquets and threaded a neat pass down the wing, with Vinicius leaving Roberto for dead. Ter Stegen denied the Brazilian winger, but Benzema was on hand to slam home the rebound.
The French forward had gone five games without a goal, but ended his drought on the big stage, showing typically perfect timing as he is expected to win the Ballon d’Or in Paris on Monday.
Vinicius was booked for complaining about a push from Roberto as Barcelona began to earn a foothold in the game, but another individual error quickly pulled it away from them.
Eric Garcia’s loose header found Vinicius in a dangerous area and Madrid toyed with Barcelona’s defence, dragging them one way before Ferland Mendy passed the ball back across for Valverde to drill home from the edge of the area.
Madrid continued to push forward after the break and Benzema curled home a third, but it was ruled out for offside.
At the other end La Liga’s top scorer Robert Lewandowski sent a free-kick into the wall and appealed for a penalty after Dani Carvajal collided with him in the box, but the referee was not interested.
Substitute Fati angled a strike wide from outside the area but Madrid were largely comfortable, sitting back and keeping Barcelona at arm’s length until Torres struck.
Fati’s brilliant run and cross for the Spanish winger gave Barcelona a lifeline, but Madrid sealed the win when Garcia trod on Rodrygo in the area and he beat Ter Stegen from the spot.
“We are very disappointed,” Barca defender Kounde told DAZN. “I don’t think we had a bad game but in the first half we failed where they are strong, on transitions.
“I think that for the first goal we should have committed a foul to stop the counter attack, and the second is quite similar. That’s the strength of (their) team. Sometimes they don’t have the ball, are suffering and then they score two goals.”