Cristiano Ronaldo’s late goal gave 10-man Real Madrid victory in El Clasico and ended La Liga leaders Barcelona’s 39-match unbeaten run.
Gerard Pique’s powerful downward header from a corner had given Barca a 56th-minute lead after a tense first half.
Karim Benzema’s brilliant scissor kick made it 1-1, before Gareth Bale had a goal harshly ruled out for a push.
After Real captain Sergio Ramos was dismissed for receiving two bookings, Ronaldo’s superb finish won the game.
BBC and balance beats Barca
Ronaldo’s winner will undoubtedly grab the headlines, particularly as it has helped third-placed Real salvage some pride from a poor season to date, but the balance of the side was crucial to the victory.
Under Rafa Benitez, Real were overwhelmed 4-0 by Barcelona at the Bernabeu in November, but they showed far more steely edge at the Nou Camp.
Benitez was punished heavily for not picking Casemiro in midfield that night, an error that his successor Zinedine Zidane avoided repeating in his first El Clasico as a manager.
PLAYER RATINGS: ‘Bale had possibly his best game for the club’
Casemiro’s influence in breaking up Barcelona’s attacks – and ensuring that Lionel Messi, Luis Suarez and Neymar were frustrated – was crucial.
Real’s front trio of Benzema, Gareth Bale and Ronaldo, nicknamed the BBC, played their part in the win, though.
Benzema recovered from a bad first-half miss to score acrobatically from Toni Kroos’ deflected cross, while Bale could count himself unfortunate to have a goal ruled out when he headed in Ronaldo’s chip, with the officials judging that he had pushed Jordi Alba.
Ronaldo, having had little impact on the match until the closing stages, grabbed his 42nd goal of the season late on, chesting down Bale’s cross at the far post before driving a shot between the legs of goalkeeper Claudio Bravo.
Barca beaten on an emotional night
It was an emotional night at the Nou Camp, as Barcelona united to pay tribute to their iconic former player and manager Johan Cruyff, who died of cancer on 24 March, aged 68.
Barca’s players wore shirts embroidered with the message “Gracies Johan”, while the fans lifted up sheets of paper in the stands before kick-off to spell out the same message.
The hope for the home side was that their modern attacking greats would produce a performance worthy of the Dutch master.
But it was no to be, with Suarez’s early miss – failing to connect with Neymar’s square pass when free eight yards from goal – the first sign of what would be a disappointing night.
Indeed, Barcelona’s goal came not from the stellar attacking trio, who have scored 103 times between them this season, but from a player who went to school in Sale.
Pique was educated in the Greater Manchester town, at Ashton-on-Mersey School, when he was in the youth set-up at Manchester United.
Having found the net just once in La Liga all season before Real’s visit, Pique picked the perfect time to score his second, escaping the attentions of Pepe and rising to power in a header from a corner.
It was not to be enough, though, as Luis Enrique’s side lost for the first time since 3 October, when they were beaten 2-1 at Sevilla.
Ramos falls off disciplinary tightrope
Perhaps the greatest puzzle of this gripping encounter was how Real Madrid captain Ramos managed to stay on the pitch for as long as he did.
The Spain centre-back was booked inside the first 10 minutes for dissent after appealing unsuccessfully that he had been fouled by Suarez.
After that, Ramos walked a very, very fine line. He could have gone when he appeared to bring down Messi on the edge of the penalty area, but referee Alejandro Hernandez did not even give a free-kick.
In the second half, the defender escaped a second yellow card after fouling Suarez from the back, and then avoided punishment altogether when he caught Alves with a trailing elbow while up for a corner.
Eventually, his luck ran out. With seven minutes left, Ramos clattered into Suarez again, and was given his marching orders. Astonishingly, Real then found a winning goal just a couple of minutes later.
Man of the match – Casemiro (Real Madrid)
Barcelona – still six points clear at the top of La Liga – host Real’s neighbours Atletico Madrid in their Champions League quarter-final first leg on Tuesday, before resuming their league campaign at Real Sociedad next Saturday.
Real head to Germany to face Wolfsburg in the Champions League on Wednesday, then host Eibar in the league three days later.