Ajax produced one of the greatest Champions League comebacks as an historic 4-1 victory at the Bernabeu dumped holders Real Madrid out 5-3 on aggregate.
With Real leading 2-1 from the first leg, Ajax travelled to Madrid needing to score at least two goals to reach their first quarter-final in 16 years - they achieved that inside 18 minutes as Hakim Ziyech and David Neres put the visitors in control.
A sumptuous third from Dusan Tadic (62) was allowed to stand after a VAR review and, though Marco Asensio sparked hopes of a late Real rally, they were extinguished 18 minutes from time as Lasse Schone's audacious free-kick from an impossible angle looped over Thibaut Courtois.
Real's fourth consecutive home defeat, their biggest in European competition, marks the end of an era at the Bernabeu after four Champions League wins in the last five seasons, while it could have huge ramifications on the future of manager Santiago Solari.
Real Madrid: Courtois (4), Carvajal (4), Varane (5), Nacho (3), Reguilon (4), Modric (5), Kroos (5), Casemiro (4), Vinicius Jr (4), Vasquez (4), Benzema (5).
Subs: Bale (5), Asensio (6), Valverde (n/a).
Ajax: Onana (7), Mazraoui (8), De Ligt (9), Blind (8), Tagliafico (8), Van de Beek (8), Schone (8), De Jong (8), Ziyech (8), Tadic (10), Neres (7).
Subs: Dolberg (5), De Wit (5), Veltman (n/a).
Man of the Match: Dusan Tadic
Remarkably, Real could have put the tie out of Ajax's reach inside four minutes, Raphael Varane cannoning a header against the angle of post and bar from a fine Lucas Vazquez cross.
But they paid the price for that miss, the visitors taking just three minutes to take advantage of their reprieve. Tadic picked Sergio Reguilon's pocket, raced into the area and shifted the ball into the path of Ziyech, whose well-placed shot flashed past Courtois into the bottom corner.
And, on 18 minutes, Ajax were in dreamland. Tadic was the architect again, pirouetting his way through the Madrid defence before playing Neres into space in the area from where he rounded Courtois to double Ajax's lead.
Real's hopes of staging a comeback were dented by the loss of Vazquez and Vinicius Jr to injury in the space of three first-half minutes, Gareth Bale and Marco Asensio came on and the Welshman nearly grabbed Real a lifeline, but his near-post shot hit the woodwork three minutes before the break.
Real and Ajax readily exchanged blows in a pulsating start to the second half before the inspirational Tadic stamped his mark on the game, rifling a thunderous drive into the top corner at the end of the flowing counter, the goal allowed to stand after a lengthy VAR review ruled that full-back Noussair Mazraoui had kept the ball in play.
Lucas Vazquez replaced Gareth Bale in the Real Madrid line-up, while Nacho came in for the suspended Sergio Ramos in defence. Ajax boss Erik ten Hag named the side XI from the first leg three weeks ago.
Asensio then swept home from Reguilon's cross to leave Real with 20 minutes to score the two more goals they needed to progress. But their faint hopes of a comeback lasted less than two minutes as Schone's free-kick from far on the left flank outwitted Courtois on its way into the top corner.
Frustration then got the better of Real as defender Nacho was shown two yellow cards and then a red to compound a miserable evening for the dethroned champions of Europe, while Ajax rejoiced in their first knockout win in the competition in 22 years.
- Real Madrid are the first reigning Champions League winners to fail to qualify for the quarter-final stage since Chelsea in 2012-13 (knocked out in the group stage).
- Real Madrid's 4-1 defeat to Ajax was their biggest ever margin of defeat a home knockout game in European competition.
- Ajax are unbeaten in each of their previous 48 Champions League matches in which they've scored the opener (W40 D8).
- Ajax have progressed through a Champions League knockout stage tie for the first time in 22 years - last doing so in the 1996-97 campaign when the Dutch side prevailed against Atlético Madrid in the quarter-finals.
- Real Madrid have lost four successive games at the Bernabeu for just the third occasion in their history - also doing so in 1995 and 2004.
- Ajax are just the third away side to score 4+ goals in a Champions League match at the Bernabeu (also, Bayern Munich 4-2 in February 2000 and Schalke 4-3 in March 2015).
- Ajax are only the second team to eliminate Real Madrid from a European knockout tie having lost the first leg at home, after Odense Boldklub in the 1994-95 UEFA Cup.
- Ajax's Dusan Tadic has been directly involved in more goals than any other player in the Champions League this season (6 goals, 3 assists).
- Dusan Tadic is the second Ajax player to have scored 6+ goals in a single Champions League campaign, after Jari Litmanen (1994-95 and 1995-96).
Santiago Solari: "The season is difficult, but we are here to show our heart and character in difficult moments. Easy moments are easy for everyone, you can climb up and surf them, but difficult moments you have to show bravery."
Erik ten Hag: "This was pretty close to perfection. Over the two matches we definitely deserve to progress to the next round."
Real resume their La Liga campaign away at Real Valladolid on Sunday (7.45pm GMT) while Ajax travel to Fortuna Sittard in the Eredivisie on the same day (3.45pm GMT).