Spain kept themselves on course to win a fourth European Championship as Mikel Merino's 119th-minute goal sent them into the semi-finals and eliminated hosts Germany following a pulsating encounter at Stuttgart Arena.
This was the most anticipated match of the tournament so far as it put together the resurgent home nation against arguably the best-performing side to date at Euro 2024 - and it certainly lived up to expectation.
Played with aggression, tension and drama the contest barely let those watching pause for breath from the moment Dani Olmo gave Spain the lead six minutes into the second half.
The substitute side-footed home a cross from 16-year-old star Lamine Yamal - his third assist of the Euros - and his strike opened up a game that had been played with caution until then.
Germany hit the post through their own substitute Niclas Fullkrug, but equalised in the final minute of normal time when Florian Wirtz sent a thunderous strike in off the post to send the home fans wild.
Mikel Oyarzabal and Wirtz then sent efforts agonisingly wide in extra time, Spain goalkeeper Unai Simon superbly clawed away a Fullkrug header while Germany had penalty appeals dismissed after the ball struck Marc Cucurella's hand in the box.
But with seconds remaining of a thrilling tie, Real Sociedad forward Merino - who spent the 2017-18 season at Newcastle United - thumped home a header to send Spain into the semi-finals, where they will face France in Munich on Tuesday, 9 July.
Full-back Dani Carvajal was sent off just before the end for a second yellow card, but it was not enough to spoil the Spanish celebrations as fans and players greeted the final whistle with joy and relief.
After disappointing performances at recent major international tournaments, this Germany side impressed, with exciting young talent like Wirtz and Jamal Musiala providing optimism for the future.
But that future will be one without the legendary Toni Kroos, with the 34-year-old having said this tournament would be his last as he retires from football.