Marco Reus scored twice as Bundesliga leaders Borussia Dortmund came from behind to beat Bayern Munich 3-2 in a thrilling Der Klassiker showdown at Signal Iduna Park.
Robert Lewandowski had put Bayern ahead against his former club with a bullet header, but Reus equalised from the penalty spot early in the second half.
The Poland forward nodded in a second before Reus levelled again with a stunning finish and substitute Paco Alcacer secured a memorable victory with a third on the break.
Lewandowski, though, was twice denied a hat-trick by an offside flag – the second coming deep into stoppage time as Dortmund opened up a seven-point lead over their rivals, who stay third.
Dortmund, looking to equal the club record of 11 Bundesliga games without defeat, started brightly as English winger Jadon Sancho almost got clear on the counter.
On 10 minutes, Reus burst into the Bayern penalty area but produced a tame effort which his Germany team-mate Manuel Neuer saved comfortably.
Lewandowski, who left Dortmund in 2014, went down looking for a penalty under what looked minimal contact at best from Julian Weigl, but the referee waved play on.
Bayern slowly started to take control and Lewandowski finally made the pressure count on 26 minutes, when crashing a bullet header from a cross by Serge Gnabry past stand-in Dortmund keeper Marwin Hitz.
Dortmund regrouped at the interval and were awarded a penalty just three minutes into the second half.
Sancho played a pass into the right side of the area for Reus, who touched the ball past the diving Neuer, the goalkeeper’s momentum taking the forward down.
Despite protests, the penalty stood following another look by the video assistant referee and Reus made no mistake from the spot.
The lead, though, did not last long as Bayern went back in front on 52 minutes. The ball dropped to Joshua Kimmich on the touchline and his lofted cut-back sat up for Lewandowski to head in.
Dortmund almost got themselves level again when Sancho’s pass found Reus, who knocked the ball past Neuer only for Kimmich to make a remarkable clearance off the line.
As the hour passed, Lewandowski thought he had grabbed a hat-trick when crashing an angled drive into the top-left corner, but the offside flag was up.
Bayern somehow survived again on 62 minutes when Sancho darted into the right side of the penalty area and clipped the ball back into the centre.
Alcacer, though, failed to convert as Jerome Boateng made a superb saving tackle and Jacob Bruun Larsen crashed the rebound over.
Reus clipped another good chance wide before sweeping in a superb finish without breaking stride from a cross by Lukasz Piszczek on 67 minutes to make it 2-2.
Dortmund completed the turnaround on 73 minutes.
Ribery was caught in possession by Sancho, who fed Axel Witsel. The Belgian picked out Alcacer, who stayed ahead of the retreating Bayern defence to slot past Neuer.
Bayern looked for a late equaliser, which almost arrived when a free-kick from Kimmich was inadvertently headed back towards his own goal by Reus, the ball dropping just past the post.
In stoppage time, Lewandowski flicked the ball home from close range – only to be denied by the offside flag once again, with the correct decision confirmed by VAR.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Press Association Sport staff');
ga('pacontentapi.set', 'dimension2', '66463209-c23f-4975-b0eb-2d767b877ea3');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:football,paservice:sport:match-reports,paservice:sport:world');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Borussia Dortmund hold on for thrilling win in Der Klassiker'});