Match ends, Belgium 3, Japan 2.
Belgium completed a remarkable revival as they came from the World Cup abyss and beat Japan to reach the quarter-finals.
Roberto Martinez's side were trailing 2-0 when he brought on Marouane Fellaini and Nacer Chadli in the 65th minute, and Fellaini scored the equaliser before Chadli netted a 94th-minute winner.
They now face Brazil in the last eight on Friday.
Japan looked on their way to a famous win in Rostov after Genki Haraguchi ran onto Gaku Shibasaki's long ball, which Jan Vertonghen should have cut out, to open the scoring.
Takashi Inui's 25-yard strike made it 2-0 and looked set to take the Asian side into their first quarter-final.
Belgium's Premier League stars - their golden generation - had put in a disappointing performance, and Martinez turned to the oft-ridiculed Fellaini and West Brom winger Chadli in his hour of need.
Their fortunes changed after that as Vertonghen scored a looping header to get them back into the game.
Fellaini then headed in Eden Hazard's cross to level before Chadli converted Thomas Meunier's pass to finish off a flowing move and help the Red Devils avoid being the latest victims of a World Cup of shocks.
Belgium are the first team to fight back from two goals down to win a World Cup knockout game since West Germany against England in 1970.
- How you rated the players in Belgium's win
- Relive the action as it happened
- Listen to the latest World Cup Daily podcast
Belgium find a winning mentality at perfect time
Belgium clearly have the players - Hazard, Kevin de Bruyne, Romelu Lukaku and Thibaut Courtois are some of the Premier League's undoubted stars. They are now unbeaten in 23 games, but there are always questions about whether they are tactically astute.
Martinez and his players will feel they have gone some way to answering those, and finding a real winning touch, having looked dead and buried after an hour.
Chelsea winger Hazard had hit the post in one of their few good chances in the opening 60 minutes.
But they ground their way back into the game - even though the goal to give them hope was a bit of a fluke. Inui booted the ball up into the air and Vertonghen's looping header flew over keeper Eiji Kawashima, who should have done better.
At 20 yards, it is the longest headed World Cup goal since those stats were first recorded in 1966.
Then the substitutes came to the fore. Fellaini, who signed a new Manchester United deal last week, powered in Hazard's centre to level the scores after 74 minutes.
And the winner was a real team effort. Goalkeeper Courtois rolled the ball to De Bruyne, who had been quiet for 90 minutes but exploded into life when his country needed him.
The Manchester City playmaker carried the ball 60 yards before feeding Meunier, his cross was stepped over by Lukaku, and Chadli was on hand to steer it home.
Lukaku had scored 17 goals in his previous 11 Belgium games but his decision to not shoot on this occasion might prove more crucial than any of those.
Can Belgium now win the World Cup?
Belgium will feel a huge amount of spirit building after this fightback - and also when they reflect on the fact their last defeat was Martinez's first game in charge, against Spain in September 2016.
Their past two tournaments - the 2014 World Cup and Euro 2016 - have both come to an end at the quarter-final stage. The Red Devils, who have never won a major tournament, will be desperate to go at least one step further this time - but there is one huge problem.
Their next game is against the favourites to win the tournament, five-time champions Brazil, on Friday in Kazan. The winner of that game faces either 1998 kings France or two-time winners Uruguay for a place in the final.
They will not need reminding that if they had lost to England in the final group game, instead of beating them, no World Cup winners would have stood between them and the final.
"Belgium had to dig deep from within and they did it so well," said BBC Radio 5 live's Chris Sutton. "Belgium are not going to have a harder game than this all tournament. They were in a real scrap."
So close... yet so far away for Japan
Japan have taken big gambles in the past few months and after an hour in Rostov, it looked like they were paying off in style.
First they sacked head coach Vahid Halilhodzic and replaced him with Akira Nishino two months before the tournament started.
Then they controversially sat back in order to maintain a 1-0 deficit in their defeat by Poland in their final group game - even though a goal elsewhere could have knocked them out.
And it looked as if Samurai Blue were going to become only the third Asian nation - after South Korea in 2002 and North Korea in 1966 - to reach the World Cup quarter-finals when they deservedly took the lead.
Haraguchi kept his composure to shoot across Courtois and give them the lead and then the impressive Inui blasted in a long-range second to put them in control.
In truth, they did not have a host of chances - with only four shots on target - and all the momentum had deserted them by the time Chadli placed the ball past Kawashima with seconds remaining.
"Japan will regret the last two minutes because they threw everything forward and they were a little bit too open at the back," said BBC One pundit Jurgen Klinsmann, a former Germany international. "In the 94th minute, the players are tired and they are thinking about extra time, and that is when mistakes happen."
What they said - 'it was a tragedy'
Belgium boss Roberto Martinez: "You get pushed in games. Let's congratulate Japan, they played the perfect game. They were clinical on the counter and so solid. It was a test of character and you see the reaction of our subs coming on to win the game. It tells you everything about this group of players.
"No negatives today, it was about getting through. It is a day to be very proud of these players. Keep believing in Belgium. In the World Cup you want to be perfect but it's about getting through, it's about winning."
Japan coach Akira Nishino: "I am devastated. Yes we took the lead but we couldn't win. It might have been a very small difference but I felt there was nothing in it.
"Maybe it was my decisions as a coach or my tactics, and we couldn't keep up with Belgium, who upped their game.
"I don't want to admit it. I do feel that it was a tragedy but I have to accept the defeat as a fact."
Man of the match - Takashi Inui (Japan)
The ninth last-minute winner of this World Cup - match stats
- 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 Russia 2018, their highest ever tally in a single World Cup tournament.
- There were just four minutes and 16 seconds between Japan's two goals, and just four minutes and 30 seconds between Belgium's brace to level the scores.
- There have now been nine 90th-minute winning goals in the 2018 World Cup. There were just 10 in the previous five tournaments combined.
- Eden Hazard has been directly involved in 19 goals in his 18 games for Belgium under Roberto Martinez, scoring 10 and assisting nine.
- 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).
- Both of Marouane Fellaini's World Cup goals for Belgium have been headers.
- Nacer Chadli scored his first goal in 11 games for Belgium, his previous effort coming against Estonia in June 2017.
- 7De Bruyne
- 11CarrascoSubstituted forChadliat 65'minutes
- 14MertensSubstituted forFellainiat 65'minutes
- 10E Hazard
- 16T Hazard
- 19H Sakai
- 7ShibasakiBooked at 40minsSubstituted forYamaguchiat 81'minutes
- 8HaraguchiSubstituted forHondaat 81'minutes
- 21G Sakai
- Malang Diedhiou
- Shots on Target
Second Half ends, Belgium 3, Japan 2.
Goal! Belgium 3, Japan 2. Nacer Chadli (Belgium) left footed shot from the centre of the box to the centre of the goal. Assisted by Thomas Meunier following a fast break.
Corner, Japan. Conceded by Thibaut Courtois.
Attempt saved. Keisuke Honda (Japan) left footed shot from outside the box is saved in the bottom left corner.
Foul by Vincent Kompany (Belgium).
Yuya Osako (Japan) wins a free kick in the attacking half.
Foul by Kevin De Bruyne (Belgium).
Yuto Nagatomo (Japan) wins a free kick in the defensive half.
Corner, Japan. Conceded by Thibaut Courtois.
Foul by Vincent Kompany (Belgium).
Yuya Osako (Japan) wins a free kick in the defensive half.
Foul by Romelu Lukaku (Belgium).
Maya Yoshida (Japan) wins a free kick in the defensive half.
Eden Hazard (Belgium) wins a free kick in the defensive half.
Foul by Maya Yoshida (Japan).
Offside, Belgium. Jan Vertonghen tries a through ball, but Marouane Fellaini is caught offside.
Attempt saved. Jan Vertonghen (Belgium) left footed shot from outside the box is saved in the bottom left corner. Assisted by Kevin De Bruyne.
Attempt missed. Thomas Meunier (Belgium) right footed shot from outside the box misses to the left following a corner.
Corner, Belgium. Conceded by Eiji Kawashima.