Germany will face England in the last 16 of Euro 2020 after twice coming from behind to knock battling Hungary out of the tournament.
An outstanding header by Adam Szalai, who plays his club football in Germany for Mainz, had given Hungary a shock lead in Munich.
Andras Schafer thought he had won it for the Hungarians with a header – 90 seconds after Kai Havertz had equalised – before substitute Leon Goretzka made it 2-2 six minutes from the end.
It means Germany finish second in Group F and will now meet Gareth Southgate’s England at Wembley in a hugely anticipated last-16 match next Tuesday.
In an extraordinary match, Germany were minutes away from making an embarrassing early exit when midfielder Goretzka, on as a substitute, equalised in the 84th minute with a low finish from 16 yards to send Hungary out.
Few outside Hungary will have given Marco Rossi’s side any chance of advancing after losing 3-0 to holders Portugal in their opening group game.
But they followed up a gutsy 1-1 draw against world champions France with a disciplined performance to give the home fans in the Allianz Arena a scare.
They opened the scoring after Roland Sallai’s incredible long-range pass picked up his captain Szalai to beat Manuel Neuer with a diving header.