A Mikel Merino goal in the penultimate minute of extra time grabbed Spain a dramatic 2-1 win over Germany to send them into the Euro 2024 semi-finals and keep their dreams of a record-breaking fourth European Championship title alive.
After a fiery yet goalless first half, Spain's Dani Olmo latched onto an inch-perfect pass from 16-year-old Lamine Yamal to give La Roja the lead on 51 minutes.
Niclas Fuellkrug struck the post with 14 minutes remaining but with the hosts staring at an exit, Florian Wirtz slammed in a Joshua Kimmich knock-down in the 89th minute to take the game to extra time, reports AFP.
With the game looking set for penalties, Olmo lofted a cross for Merino, who headed Spain to victory and a semi-final meeting with either France or Portugal.
"Well, I'm dead, really. The adrenaline is taking its toll on me now. It has been a special moment," goalscorer Merino said after.
Olmo said he was "exhausted really", adding: "It is a source of pride, what a great team we have, how we have fought until the end."
Germany's elimination ends the hosts' hopes of a fairytale Euros victory after a decade of poor performances at major tournaments, while also lowering the curtain on Toni Kroos' stellar career.
"We played a good tournament but when you're so close, to be eliminated like that, it's bitter," Kroos told ARD.
The battle between the two most successful Euros nations, with three titles apiece, was billed as a final come early, with the in-form Spaniards against Julian Nagelsmann's reborn hosts.
Spain nominated Kroos as Germany's most dangerous player pre-match but the midfielder had a huge, even if unintended impact early, colliding with Pedri, who was then substituted with a leg injury for Olmo.
Germany, with the oldest squad at Euro 2024, struggled with Spain's speed during the first half, frequently coming into tackles a fraction too late, but the two best chances of the opening half fell to the hosts -- and both to Kai Havertz.
The Arsenal forward leapt highest to head a cross directly at Unai Simon early and then scuffed a tame shot at the goalie later in the half with just the 'keeper to beat.
Nagelsmann took off surprise starter Emre Can for the pink-haired Robert Andrich, while the ineffective Leroy Sane was replaced by Wirtz.
- Olmo strikes -
The substitution who would make his mark however was Olmo, who gave Spain the lead six minutes into the second half, slicing through the sleepy Germany defence to perfectly place a Yamal pass past Manuel Neuer into the bottom left corner.
The goal kicked Germany into gear with Wirtz particularly dangerous.
The Bayer Leverkusen starlet linked with Fuellkrug on the counter with a quarter of an hour remaining but the striker, under heavy attention from the Spanish defence, could only hit the post.
With 10 minutes remaining Nagelsmann made his final substitution, bringing veteran Thomas Mueller from the bench.
But it was Wirtz -- 13 years his junior - who made the difference, skimming a Kimmich header across the grass and in at the far post.
Mikel Oyarzabal, on for Nico Williams, curled a 104th-minute shot just wide of the post and Wirtz did the same a minute later with the goal beckoning.
Germany appealed strongly for a penalty in the second period of extra time, after a Jamal Musiala shot hit Marc Cucurella's hand, but after a VAR check the original decision to not award a spot-kick stood.
Minutes later, Olmo curled in a cross for Merino, who leapt high to head the ball past Neuer and put Spain into the semi-finals.
Luis de la Fuente will be forced into changes for Tuesday's semi, after Dani Carvajal received his marching orders for hauling down Musiala for a second yellow card of the match.
Centre-back Robin Le Normand and captain Alvaro Morata will also be suspended for picking up yellows, with the Spain skipper earning a late caution for his celebrations in the aftermath of Merino's winner.