Nacer Chadli's 94th-minute winner completed a sensational comeback as Belgium beat Japan 3-2 to book a World Cup quarter-final against Brazil.
After a goalless first half, Japan struck twice in seven minutes following the interval to take full control of a gripping last-16 tie in Rostov-on-Don on Monday.
Genki Haraguchi and Takashi Inui scored stunners as Japan looked set to reach the first World Cup quarter-final in their history.
But, instead, Belgium became the first team to come from two goals down to win in a World Cup knockout game since 1970 and will now face five-time winners Brazil on Friday.
Jan Vertonghen's looping header somehow beat goalkeeper Eiji Kawashima and Belgium's aerial power started to tell when Marouane Fellaini thumped home Eden Hazard's brilliant left-wing cross.
Keisuke Honda almost beat Thibaut Courtois with a free-kick in injury time but a clinical Belgium counter-attack, which ended in Thomas Meunier setting up Chadli for a simple finish, broke Japanese hearts.
And a moment of madness from Courtois almost handed Japan the lead just before half-time, the goalkeeper spilling a tame shot from Yuya Osako but recovering to claw the ball back.
Japan had never scored a goal in the World Cup's knockout rounds but they ended their wait in the 48th minute through Haraguchi.
Another Belgium move broke down on the edge of the Japan box and Roberto Martinez's men fell victim to a rapid break, Gaku Shibasaki slipping a pass through to Haraguchi, who rifled a stunning shot across Courtois.
Hazard struck the post from Dries Mertens' pass as Belgium almost levelled immediately.
But within four minutes of taking the lead Japan were 2-0 up, Inui's strike perhaps even eclipsing Haraguchi's outstanding opener.
Shinji Kagawa was the creator, collecting a loose ball after a poor clearance and feeding Inui, the midfielder working himself a yard of space before arrowing home a 25-yard rocket.
When Romelu Lukaku somehow headed a perfect Meunier cross wide Belgium seemed to be heading out.
But they were given a lifeline when Vertonghen's looping header eluded goalkeeper Kawashima after a corner caused chaos in the Japan penalty area - and five minutes later they were back on level terms.
Hazard twisted and turned to create space on the left wing, his cross perfectly delivered for substitute Fellaini to climb above his marker and crash in a downward header that gave Kawashima no chance.
Both sides had chances to win it, Kawashima making a magnificent save to tip over Lukaku's header before Courtois turned a speculative Keisuke Honda free-kick wide in added time.
Japan sensed their chance to snatch a late winner but Courtois claimed the resulting corner and within seconds the ball was in the net at the other end.
Courtois found Kevin De Bruyne with a long throw and the Manchester City playmaker freed Meunier with a terrific pass that left Japan struggling to cover the break.
Meunier kept his cool to square a low cross and, when Lukaku dummied the ball, substitute Chadli was on hand to sweep Belgium into an unlikely quarter-final meeting with Brazil.
- Belgium are the first team to come from two or more goals down to win a World Cup knockout stage match within 90 minutes since Portugal beat DPR Korea in the 1966 quarter-final (0-3 down, 5-3 win).
- Belgium have reached the World Cup quarter-finals in successive tournaments for the first time.
- Belgium have never kept a clean sheet in their 12 World Cup knockout round matches, shipping 28 goals in total.
- Japan have scored six goals at the 2018 World Cup, their highest ever tally in a single World Cup tournament.
- There have now been nine 90th minute winning goals in the 2018 World Cup. There were just 10 in the previous five tournaments combined (1998, 2002, 2006, 2010 and 2014).
- Takashi Inui is only the third player to have scored multiple goals in a World Cup tournament for Japan, after Junichi Inamoto in 2002 (2) and Keisuke Honda in 2010 (2).