Sweden topped Group E and sent Poland home from the European Championship on Wednesday with a stoppage-time winner to make it 3-2 in one of the tournament's most exciting games.
Sweden appeared to be cruising after Emil Forsberg scored the second fastest goal in Euros' history a mere 82 seconds in, followed by a second-half breakaway strike.
But Poland's Robert Lewandowski, who hit the bar twice in the first half, narrowed Sweden's lead two minutes later with a curling shot from outside the edge of the penalty area, then got a second in the 84th minute to set up a thrilling finale.
Viktor Claesson got Sweden's winner in stoppage time.
In the knockout stage, Sweden will face one of the third-placed sides in Glasgow on June 29.
Spain, who beat Slovakia 5-0 in the other Group E game to come second, will meet Croatia in Copenhagen on June 28.