Winger Emil Forsberg set the Swedes on their way with two goals, including the second fastest strike in European Championship history, before Viktor Claesson stepped up in the fourth minute of stoppage time to seal a 3-2 victory.
Sweden will next face one of the third-placed sides from Groups B, C or D - Finland, Ukraine or the Czech Republic - in Glasgow on June 29.
It was a heartbreaking end to Poland's campaign following a thrilling fightback in which they twice drew level through talismanic skipper Robert Lewandowski, whose 84th minute equaliser for 2-2 gave them a surge of hope.
Sweden's previous two matches were built on robust defensive displays that had cast doubts on whether Janne Andersson's side could get their attack firing, but they made a blistering start.
After Robin Quaison controlled the ball on the edge of the penalty area, Forsberg collected a pass and took advantage of some poor defending to fire past goalkeeper Wojciech Szczesny with a mere 82 seconds on the clock.
It was the fastest goal in the Euros since Dmitry Kirichenko for Russia versus Greece in 2004.
Forsberg doubled their lead with a powerful drive for his third goal of the tournament after substitute Dejan Kulusevski weaved his way into the box to lay it on a platter in the 59th minute.
Lewandowski pulled a goal back two minutes after Sweden's second with a curling shot. Then Jakub Swierczok's tap-in from substitute Przemyslaw Frankowski's pass was ruled out for offside after the Video Assistant Referee's intervention.
Lewandowski, who thundered two first-half headers onto the crossbar, fired in the equaliser from close range in the 84th minute after a pass from Frankowski.
Chasing their first victory over Sweden since 1991, Poland pushed on but Sweden withstood waves of pressure before Kulusevski pivoted outside the penalty area and played in Claesson who held his nerve to clip the ball over Szczesny.
Spain crush Slovakia to set up Euros last-16 date with Croatia
Spain claimed the biggest win of the tournament with a 5-0 thrashing of Slovakia in their final European Championship Group E match on Wednesday to finish second in the group and set up a last-16 clash with Croatia in Copenhagen.

Soccer Football - Euro 2020 - Group E - Slovakia v Spain - La Cartuja Stadium, Seville, Spain - June 23, 2021 Slovakia's Tomas Suslov in action with Spain's Thiago and Aymeric Laporte. (Photo: Reuters)
Goals from Aymeric Laporte, Pablo Sarabia, Ferran Torres and two own goals from Martin Dubravka and Juraj Kucka sealed Spain's progress to the knockout stages.
Slovakia were eliminated as four other third-placed teams had either more points or a better goal difference.
Dubravka saved an early penalty from Alvaro Morata but gifted Spain the opener when he attempted to punch a rebound off Sarabia's shot over the bar, only to palm it into his own net.
Aymeric Laporte doubled the lead before halftime. Sarabia was then rewarded with a goal when left back Jordi Alba swung a cross into the box and the Paris Saint-Germain winger found space to take a first-time shot that went in off the post.
Sarabia turned provider when he set up substitute Ferran Torres who scored within a minute of coming on, flicking a low cross past Dubravka for the fifth. Spain forced another own goal minutes later when Kucka failed to clear off the line.