Cristiano Ronaldo's late strike sealed a 2-1 comeback win for 10-man Real Madrid in El Clasico as Barcelona's 39-game unbeaten run was ended.
Gerard Pique had given the hosts the lead at the Nou Camp with a towering header from Ivan Rakitic's corner on 56 minutes, but Real swiftly levelled through Karim Benzema's acrobatic volley.
Gareth Bale then had a goal controversially ruled out, and when Sergio Ramos was sent off for a second yellow card with seven minutes remaining, it looked like Barca would make the visitors pay.
But Ronaldo stepped up with an 85th-minute winner for Zinedine Zidane's side, taking the ball on his chest before drilling home from close range.
The defeat for Barca, combined with Atletico Madrid's 5-1 victory earlier on Saturday, means their lead at the top of La Liga has been cut to six points over Atleti and seven points over Real.
Andres Iniesta replaced Arda Turan in Barcelona's only change from the 2-2 draw against Villarreal, and after a fitting tribute to the late Johan Cruyff, the hosts quickly settled into their rhythm.
Ramos, back in the line-up after missing the win over Sevilla, slipped to present the first chance of the game to Luis Suarez, but the striker failed to test Keylor Navas from point-blank range.
Rakitic did better shortly after, drawing a save from the Real Madrid goalkeeper, but a subdued first-half performance from Barca saw the Nou Camp crowd direct much of its ire towards referee Alejandro Jose Hernandez Hernandez, and when he failed to award a penalty for an apparent trip by Ramos on Lionel Messi, the white flags came out.
Zidane's side grew into the game, frustrating Barca and striking on the counter-attack, and Ronaldo tested goalkeeper Claudio Bravo with a speculative hit from distance.
It threatened to get scrappy when Suarez was booked for catching Pepe with a stray arm, and with neither side at their fluent best, the poor finishing continued as Dani Alves and Benzema each snatched at opportunities before half-time.
The jeers and whistles became louder after the break when Ramos, booked in the first half for dissent, was twice fortunate to avoid a second yellow card, and in an otherwise cagey game, it was fitting the breakthrough came from a set piece.
Navas had clawed away a delightful chip from Messi just moments before, but Pique was not to be denied when he powered a header past the Real 'keeper to hand the league leaders the edge.
It sparked the game into life and prompted a swift response from Real, who were level six minutes later via Benzema's 21st league goal of the season. Toni Kroos broke free down the right, and when his cross took a deflection, the Frenchman was on hand to turn home.
The strike appeared to rattle Barca as their opponents pushed for a winner, and Real felt they were denied a legitimate goal when Bale's back-post header was ruled out for a foul on Jordi Alba.
With Messi largely on the periphery, Real remained on the front foot as Ronaldo struck the crossbar with a fizzing drive, before a second yellow card for Ramos for a clumsy challenge on Suarez threatened to check their momentum.
But rather than sit back with 10 men, Real continued to push forward and were rewarded with five minutes to play when Ronaldo popped up to calmly control and finish past Bravo to win the tie.