Brazilian superstar Neymar opened the scoring early on in the Spanish capital, but Real moved to within one point of the La Liga summit as Cristiano Ronaldo, Pepe and Karim Benzema offered the perfect response.
There were just four minutes on the clock when Barcelona got off to a dream start, with debutant Luis Suarez – back in competitive action after serving a four-month ban – spreading play to Neymar, who cut inside off the left and drilled low into the bottom corner.
That was to be as good as it got for the visitors, with parity restored on 35 minutes as Gerard Pique was penalised for handling a Marcelo cross and Ronaldo made no mistake from the penalty spot as he sent Claudio Bravo the wrong way.
Six minutes into the second half and Real edged in front as Pepe powered home a header from a corner.
Benzema then made it three just past the hour mark, with a flowing move that involved Isco, Ronaldo and James Rodriguez rounded off by the French striker as he fired across Bravo from just inside the box.
Carlo Ancelotti made two changes to the team that had crushed Liverpool in midweek, bringing in Dani Carvajal and Sergio Ramos for Alvaro Arbeloa and Raphael Varane, while Luis Enrique picked Jeremy Mathieu at left-back instead of Jordi Alba and chose Xavi over Ivan Rakitic in midfield.
Suarez made his competitive debut for Barca 18 hours after his ban for biting Italy Giorgio Chiellini during the World Cup came to an end.
Barcelona turned up on enemy territory top of the table and without having conceded a league goal and needed just four minutes to break the deadlock.
Xavi spread the play out to Suarez on the right-hand side and the debutant picked out Neymar unmarked on the edge of the area, with the Brazilian cutting inside to the right to drive the ball into the far corner, leaving Iker Casillas and 75,000 Madrid fans stunned.
The hosts wasted no time in responding with a barrage of attacks. Benzema beat Bravo to a ball over the top but was unable to steer his shot on target.
Then Marcelo’s cutback fell just a yard or two beyond Benzema. It was not long before the Frenchman was bearing down on goal yet again, first heading a cross from Ronaldo onto the bar and then controlling the rebound and striking the near post.
Barca took their time to rearm but came within inches of a second midway through the first half. Suarez again found space on the right and drilled the ball across to Lionel Messi at the far post but Casillas was able to put off the Argentinian and force a corner.
Neymar then found space in the area but was robbed before he could shoot by Carvajal.
There had been four failed penalty appeals in total by the half hour but referee Jesus Gil Manzano pointed to the spot at the fifth time of asking, penalising Pique for touching the ball with his hand as he slid to the floor to defend Marcelo’s cross.
Ronaldo stepped up confidently to slam the spot-kick into the bottom corner and become the first player to score against Barcelona in the league this season. It was also the prolific Portuguese’s 15th consecutive league goal at the Bernabeu.
Madrid could have even nosed ahead just before the break, Rodriguez ghosting in to meet a Marcelo cross but heading wide.
Madrid made a strong start to the second half and won a corner when Pique deflected Ronaldo’s shot wide. Toni Kroos sent an out-swinging corner into the heart of the box where Pepe leapt to nod into the net.
But Barca nearly hit back, Mathieu’s rasping drive tipped around the post by Casillas.
The visitors pushed for an equaliser but conceded the killer third goal after winning a corner. Rakitic’s low corner was intercepted by Ronaldo, who launched a quick break. An error by Andres Iniesta on the touchline allowed Isco to find Ronaldo, who in turn released Rodriguez before the ball dropped to Benzema to fire in off the far post.
Barca were undone by a combination of their own mistakes and Madrid’s blistering power on the break. They never recovered, and their arch rivals marched on to their ninth straight win in all competitions.