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.