But a Robert Lewandowski double put Poland within a goal of the win they needed to advance - only for Claesson to end their hopes.
Sweden will now prepare for a last-16 tie against Finland or Ukraine at Glasgow's Hampden Park on 29 June.
The Swedes netted their first goal from open play at the tournament just 82 seconds into their final Group E game thanks to Forsberg's composed angled finish.
The RB Leipzig midfielder doubled the lead with a first-time shot - his third goal at the tournament - before Lewandowski produced a quality arrowed finish.
The Bayern Munich striker then conjured an 84th-minute equaliser, but Claesson's late goal was decisive.
Poland captain Lewandowski was earlier guilty of an incredible miss with Sweden leading 1-0.
After heading against the underside of the bar from a corner, his follow-up header from just two yards out struck the bar.