With less than an hour left, all hope of reaching the semi-finals disappeared when Croatia beat Hungary.
It was therefore a disappointing blue-and-yellow farewell to the European Championship audience at home in Malmö Arena.
"Many people were tested mentally today, but we did a great job," Andreas Palicka told Viaplay.
Sweden started unfocused and fell behind 8-12. But just before halftime, they scored six straight goals, a turnaround that led to victory.
Eric Johansson scored seven goals and Palicka made numerous saves.
The national team now travels to Herning, Denmark, to finish the European Championship in a fifth-place match against Portugal on Friday afternoon.
Facts: Sweden's matches in the European Championship
TT
+ First group stage
Netherlands, 36–31.
Georgia, 39–28.
Croatia, 33–25.
+ Intermediate round
Slovenia, 35–31.
Iceland, 27–35.
Hungary, 32–32.
Switzerland, 34–21.
This is how the intermediate round ended: 1) Croatia 8 points, 2) Iceland 7 points, 3) Sweden 7 points, 4) Slovenia 4 points, 5) Hungary 2 points, 6) Switzerland 2 points.





