Real Madrid squandered a two-goal lead and with it top spot in Group F as record-breaking Borussia Dortmund fought back to draw 2-2 late on at the Bernabeu.
Karim Benzema doubled his Champions League tally this season with a goal in either half as Real overtook their opponents and moved into pole position.
However, Pierre-Emerick Aubameyang continued his remarkable scoring sequence with his 19th goal in as many games on the hour and substitute Marco Reus struck two minutes from time to wrest back top spot and with it a new Champions League record.
Reus' goal was the 21st scored by Dortmund in the Champions League group stage, surpassing the mark set by Manchester United (1998-99), Barcelona (2011-12 and this season) and Real themselves (2013-14).
Dortmund arrived in Madrid needing only a draw to retain first place in their final group match but found themselves under pressure almost from the off once Andre Schurrle had missed the target with an early chance.
We need your consent to load this rte-player contentWe use rte-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences
Veteran goalkeeper Roman Weidenfeller's legs kept out Benzema's snap-shot and his body denied James Rodriguez, both chances created via the trickery of Cristiano Ronaldo whose own barren run in Europe now extends back to late September.
The Portugal international is still two away from registering 100 European goals but has managed just a couple in the group stage, his lowest return since 2009 when he did not score until the knockout stages for Manchester United and his lowest group stage tally for Madrid.
Madrid's growing pressure eventually told in the 28th minute when charging right-back Dani Carvajal crossed for Benzema to nip in front of his marker and convert from close range.
It took almost 10 minutes for Dortmund to react with former Barcelona defender Marc Bartra curling a 25-yard effort wide.
While that was off target it signalled a good spell for the visitors as Christian Pulisic forced a low save from Keylor Navas and Schurrle's free-kick had the goalkeeper scrambling to claw away a bouncing effort.
Dortmund's highly-rated forward Pulisic then shot too close to Navas after Real were carved open, but in added time the hosts almost doubled their lead when Ronaldo, sliding in at the far post, just failed to connect with Benzema's cross.
They did not have to wait much longer as eight minutes after half-time a brilliant cross from Rodriguez saw Benzema rise between centre-backs Sokratis Papastathopoulos and Marcel Schmelzer to score with a downward header.
Aubameyang made for an entertaining finish when he fired home from Schmelzer's cushioned volley.
Weidenfeller tipped over a drive from Ronaldo, who was also denied by the post, and for once it was Real who were made to pay for missing chances.
Two minutes from time Aubameyang's pace took him away from the defence to square for Reus to score and consign Real to second place.