Artem Dovbyk scored in added time in extra time as Ukraine edged out 10-man Sweden at Hampden to set up a Euro 2020 quarter-final with England.
Oleksandr Zinchenko smashed Ukraine in front with a powerful drive but a deflected shot from Emil Forsberg levelled matters before half-time.
Sweden lost Marcus Danielson to a red card in extra time after a VAR check.
And, with penalties looming, Dovbyk - one of 12 substitutes used - headed a dramatic winner from close range.
Ukraine had crept through from the group phase with three points and a negative goal difference, while Sweden topped their section with seven points, ahead of Spain.
However, the match in Glasgow was an even contest throughout, with both sides out on their feet by the final whistle.
With so many changes in personnel and a sending off, there was no rhythm or shape in extra time.
The Swedes were twice temporarily down to nine men after head knocks and Ukraine replacement Artem Besedin lasted just 10 minutes before he was on the receiving end of Danielson's high challenge.
The Sweden defender, who got his foot to a dropping ball before catching his opponent, was initially booked but referee Daniele Orsato upgraded to red after reviewing the incident on the pitch-side monitor.
There was little in the way of goalmouth action after Danielson's 99th-minute dismissal until Zinchenko swung in a cross from the left and Dovbyk slid in to score his first international goal.
Change of shape benefits Ukraine
Ukraine coach Andriy Shevchenko switched to a back three, allowing Zinchenko to operate as a left wing-back, and his captain revelled in the role, setting up the winner and cracking in the opener on 27 minutes.
Andriy Yarmolenko found the Manchester City player with a cute outside-of-the-boot pass and Zinchenko thundered in an angled shot that Robin Olsen got a hand to but could not keep out.
Forsberg then enjoyed a slice of fortune as his deflected shot from 22 yards flew into the net just before the interval for his fourth goal of the tournament.
But the impressive midfielder's luck was out when he twice struck the woodwork in a lively second-half spell, with those shots following an effort from Ukraine's Serhiy Sydorchuk which clipped a post.
Ukraine goalkeeper Heorhiy Bushchan did well to push away a strike from Dejan Kulusevski and the same player was in behind in the 89th-minute but the ball would not sit for his weaker right foot, allowing defender Illya Zabarnyi to slide in and block.
Latest Stories
-
Syria’s minorities seek security as country charts new future
34 minutes -
Prof. Nana Aba Appiah Amfo re-appointed as Vice-Chancellor of the University of Ghana
41 minutes -
German police probe market attack security and warnings
41 minutes -
Grief and anger in Magdeburg after Christmas market attack
42 minutes -
Baltasar Coin becomes first Ghanaian meme coin to hit DEX Screener at $100K market cap
2 hours -
EC blames re-collation of disputed results on widespread lawlessness by party supporters
2 hours -
Top 20 Ghanaian songs released in 2024
2 hours -
Beating Messi’s Inter Miami to MLS Cup feels amazing – Joseph Paintsil
2 hours -
NDC administration will reverse all ‘last-minute’ gov’t employee promotions – Asiedu Nketiah
3 hours -
Kudus sights ‘authority and kingship’ for elephant stool celebration
3 hours -
We’ll embrace cutting-edge technologies to address emerging healthcare needs – Prof. Antwi-Kusi
3 hours -
Nana Aba Anamoah, Cwesi Oteng special guests for Philip Nai and Friends’ charity event
3 hours -
Environmental protection officers receive training on how to tackle climate change
3 hours -
CLOGSAG vows to resist partisan appointments in Civil, Local Government Service
4 hours -
Peasant Farmers Association welcomes Mahama’s move to rename Agric Ministry
4 hours