Sweden secured their place in the knockout stages of Euro 2020 as group winners as they sent Poland crashing out with a 3-2 victory in Saint Petersburg.
The Swedes looked to be cruising into the last 16 after going two up through Emil Forsberg only for a double from Robert Lewandowski to set up a nervy finish.
However, with Paulo Sousa's side pushing for the winner they needed to avoid an early exit, they were hit on the break and condemned to defeat by substitute Viktor Claesson.
That stoppage-time goal ensured Sweden leapfrogged Spain into top spot in Group E, while Poland dropped out of the tournament with just a single point to their name.
None of the previous 26 meetings between Sweden and Poland had ended goalless and the prospect of a bore draw was eliminated inside just two minutes.
Forsberg had some poor Polish defending to thank for the opener - the second-fastest goal in Euros history (81 seconds) - which came when he bundled past multiple challenges before applying a left-footed finish.
Sweden continued to apply pressure in the aftermath, but they were indebted to some uncharacteristically poor finishing from Lewandowski with 17 minutes gone.
After heading onto the crossbar from a wicked corner delivery, the prolific Bayern Munich man somehow did the same with a close-range follow-up despite having a virtually open goal to aim at.
The Poles were subsequently restricted to long-range efforts from Piotr Zielinski, though he did at least test Robin Olsen with two ambitious efforts that sandwiched the half-time break.
But it looked like their race was run when Forsberg finished powerfully after a brilliant breakaway down the right-hand side from Dejan Kulusevski.
However, Lewandowski more than atoned for his glaring miss earlier in the match two minutes later, scampering away down the left-hand side and cutting in to unleash an unstoppable drive into the far corner.
Poland thought they had equalised just past the hour mark when Jakub Swierczok diverted a cross home only for the linesman's flag to quickly bring an end to the celebrations.
They did get their goal with six minutes of normal time remaining, though, Lewandowski making no mistake when a cross dropped to him in space in the box.
That strike set up a grandstand finish which Poland dominated, but they were ultimately undone by Claesson's slick finish, which came after more good work from Kulusevski.
What does it mean? Swedes find new gear
Having avoided conceding a goal across their first two outings at this tournament, Sweden had earned a reputation as an ugly but effective defensive unit.
But they found a new, exciting way of winning in this game, a fact that perhaps marks them out as an opponent to avoid in the knockout stages.
Forsberg the standout
Although Claesson's late strike broke his hegemony on Sweden goals, Forsberg has now scored four of his country's last five at major tournaments.
The 29-year-old is the key man in the Swedes' attack, and lived up to his billing with five shots across his 77 minutes on the pitch here.
Spare a thought for Lewandowski who, like Forsberg, took five shots and scored twice in a dominant performance but ended up on the losing side.
The prolific Pole will find it hard to forget the first-half chance that saw him hit the bar twice in quick succession.
Had they gone through as runners-up, Sweden would now know that Croatia await in the last 16.
However, having won Group E ahead of Spain, they must now wait to find out whether it will be Finland or Ukraine in the knockout stages.