Two goals from Dele Alli and one from Christian Eriksen gave Mauricio Pochettino's side a fully deserved triumph at Wembley over the holders, who were well short of their best and looked vulnerable to every Spurs counter-attack.
These two teams played out a 1-1 draw at the Santiago Bernabeu two weeks ago and there was little to separate them in a lively first half, until Alli steered in a Kieran Trippier cross.
England international Alli, who made his MK Dons debut in the FA Cup first round almost five years ago to the day, doubled his side's lead just after the break with a deflected strike to leave the visitors stunned.
It got worse for Madrid less than 10 minutes later when Eriksen finished after a pass from the returning Harry Kane, and although Cristiano Ronaldo struck a consolation goal, there was little else to smile about for the Spanish and European champions.
The win guarantees a last-16 spot for Spurs and leaves Zinedine Zidane facing a mini-crisis at Madrid, who have now lost two games in a row and are eight points adrift of Barcelona in LaLiga.
2 - Dele Alli is the third English player to score a brace against Real Madrid in #UCL, after David Beckham and Steven Gerrard. Heroic. pic.twitter.com/GohxEwTxhX — OptaJose (@OptaJose) November 1, 2017
There was a clear respect between the teams as neither seemed prepared to commit men to the attack early on, with Spurs coming closest through two ambitious chipped efforts from Kane and Harry Winks that Kiko Casilla caught easily.
The home side's high pressing looked to have unsettled Madrid, although Pochettino was dealt a blow in the 24th minute when Toby Alderweireld had to go off with what looked to be a thigh muscle problem.
However, just three minutes later, they had Wembley on its feet. Tripper sent in a first-time cross from the right and Alli stole in front of Nacho to prod the ball into the net from six yards.
Trippier looked to be fractionally offside when found smartly by Winks and any Madrid frustrations grew when Hugo Lloris made three good saves to deny Casemiro and Ronaldo twice.
The half finished in end-to-end fashion, Sergio Ramos blocking a Kane effort, Lloris stopping a Karim Benzema half-volley and Alli seeing penalty appeals waved away after a tussle with Casemiro.
But Alli had better luck 11 minutes into the second half. Having skipped past the challenge of Casemiro, his shot from 18 yards took a big deflection off Ramos and nestled into the net past the wrong-footed Casilla.
Nine minutes later, Spurs had their third. A blistering counter-attack started by Alli saw Kane send Eriksen clean through on goal and he made no mistake with a low left-foot finish past Casilla.
Madrid had not failed to score in a group game since October 2015 and they did find a consolation, with Ronaldo firing home from close range after a scramble in the Spurs box, but it did little to take the gloss off one of the London club's most famous wins in their modern history.
KEY OPTA STATS
- Tottenham have inflicted Real Madrid’s first loss in the Champions League group stage since October 2012, ending a 30 game unbeaten run.
- In fact, this is Real Madrid’s biggest margin of defeat in a Champions League group game since November 2008, losing 2-0 against Juventus.
- Tottenham have finally defeated Real Madrid at their sixth attempt after losing three and drawing two of the previous five.
- Spurs are still yet to keep a clean sheet in European competition at Wembley, conceding eight goals in six games.
- Dele Alli has scored four goals in his last four games for Spurs; one more than he managed in his first nine this season.
- Kieran Trippier has recorded 13 assists in all competitions in 2017; six more than any other Premier Leaguer defender.
- Cristiano Ronaldo has scored 10 goals v Tottenham in all comps, more than against any other English side.