Belgium's Nacer Chadli celebrates scoring their third goal against Japan at Rostov Arena, Rostov-on-Don, Russia on July 2, 2018.
The distraught Japanese, who went 2-0 up with goals by Genki Haraguchi and Takashi Inui early in the second half, fell to the turf after Chadli poked the ball home from Thomas Meunier's cross four minutes into added time at the Rostov Arena.
Much-fancied Belgium, who had taken a conservative approach to the game, got back into contention with late goals by Jan Vertonghen and Marouane Fellaini before Chadli struck in a demonstration of coach Robert Martinez's tactical nous.
One of the most exciting teams of the group phase, Belgium faced an embarrassing exit but finally clicked to become the first team to win a World Cup knockout game from two goals down since West Germany beat England 3-2 after extra time in 1970.
Belgium's 'golden generation' have now scored 12 goals in four games in Russia ahead of a last eight clash on Friday with Brazil, who beat Mexico 2-0 earlier on Monday.
With centre back Vincent Kompany back in the lineup for the first time since picking up a groin strain in a warm-up game, Belgium had looked safe at the back but uninspired up front during a first period when they were on top but toothless.
Both teams fought a tight midfield battle but their forwards froze in the area and Belgium's wide players, Meunier and Yannick Carrasco, did not take risks going forward, effectively turning a 3-4-3 formation into a more conservative 5-2-3 system.
Japan got closest to a goal in a dull first half when Belgium keeper Thibaut Courtois let the ball slip from his hands and between his legs but recovered before it crossed the line.
The Japanese were ahead soon after the break, though, when Haraguchi beat the offside trap and ran into the area to beat Courtois with a cross-shot in the 48th minute.
Belgium responded but Hazard's shot rattled the post and Japan doubled their tally in the 52nd when Inui picked up the ball 25 metres out and fired a missile into the back of the net.
The Red Devils were still struggling but they pulled a goal back after 69 minutes when Vertonghen looped a header from a high clearance back across goal into the far top corner.
The momentum had shifted and in the 74th, Eden Hazard's cross was met by Fellaini, who equalised from close range with a powerful header within 10 minutes of coming on.
Belgium continued to push forward and both Chadli and Lukaku forced Japan keeper Eiji Kawashima into spectacular saves with powerful headers four minutes from the end.