Real Madrid beat Barcelona in a captivating El Clasico to move above their rivals at the top of La Liga.
Vinicius Junior drove in via a deflection in a second half packed with chances after Isco saw a shot saved and an effort cleared off the goalline.
Karim Benzema volleyed over for Real and substitute Martin Braithwaite went close for Barca moments before Vinicius sparked celebrations at the Bernabeu.
Substitute Mariano struck in added time as Real moved a point clear of Barca.
Mariano had not played a single minute in La Liga for Zinedine Zidane’s side this season until being brought off the bench in injury time to seal a memorable win.
Los Blancos finished third last season – 19 points behind champions Barca – but the tight nature of the title race this time around placed added significance on the fixture in the Spanish capital.
Zidane had said his side were in a “delicate moment” as a result of picking up one point from their last two league matches and having suffered a home defeat to Manchester City in the Champions League in midweek.
And Real’s task looked ominous given they had not beaten Barca in the league in their last seven attempts.
Quique Setien’s side also arrived having won four league games in a row at the Bernabeu but they will rue missed opportunities in the first half.
Antoine Griezmann fired over from a Jordi Alba cut-back, Arthur was denied by Thibaut Courtois after breaking through on goal and the Madrid keeper parried a Messi effort when the Barca talisman broke the offside trap.
Going into the break, Courtois had saved 30 of the last 36 shots he had faced in La Liga and his interventions were built upon as Zidane’s side carried more threat in the second period.
Isco curled an effort at the top corner to force a fine save from Marc-Andre ter Stegen before heading low past the keeper, only for Pique to intervene.
Karim Benzema could not end a five-game goal drought when he volleyed over when unmarked before former Middlesbrough forward Martin Braithwaite had a chance to win it, only for his shot to be saved.
Vinicius then pounced, firing in from a narrow angle, the 19-year-old Brazilian becoming the youngest scorer in a league game between the sides this century as he surpassed Lionel Messi’s record set in 2007.
His side never looked back and Mariano put the finishing touches on a win which gives them real hope of landing a first league title since 2016-17.
‘Worst I have seen Madrid play at the Bernabeu’ – reaction
Real Madrid manager Zinedine Zidane: “We deserve our victory for everything we did, in attack and defence. It has been a complicated week for us and we had the chance to turn things around, and we did that.
“But this win also doesn’t change anything. We have a long way to go and we have to continue. We’ve got three important points but we’ll have more difficult games and we will be criticised again.”
Barcelona manager Quique Setien: “We were clear about what we had to do. We had to wait for our moment and be patient and try to keep the ball.
“In the second half I can’t understand why we started to lose the ball easily. We were able to breathe life back into Real Madrid. It was a shame we weren’t to take the form of the first half into the second.”
Barcelona defender Gerard Pique: “We controlled the game in the first half, which was the worst I have seen Madrid play in all the years I have played at the Bernabeu.
“We had a chance to make a real statement and if we had taken our chances they would have had a mountain to climb.
“They come out of this game feeling very strong while we feel down but we are not out. I think there is still time for us to win the league.”