Radja Nainggolan’s superb 25-yard strike secured Belgium’s place in the last 16 of Euro 2016 and knocked out Sweden, bringing to an end Zlatan Ibrahimovic’s international career.
Victory in Nice meant Belgium finished as Group E runners-up and will face Hungary in Toulouse on Sunday.
Sweden exited the competition with one point from three games in which Ibrahimovic failed to score.
The Republic of Ireland qualified in third, thanks to a 1-0 win over Italy.
Meanwhile, Chile will play Argentina in Sunday’s Copa America final after beating Colombia 2-0 in a match delayed more than two hours by a torrential storm.
They were two up at the break but the second half was halted as an electrical storm saturated Soldier Field, Chicago.
Charles Aranguiz converted a rebound past Arsenal’s David Ospina to put Chile ahead and Jose Pedro Fuenzalida struck four minutes later.
The Colombians will now play hosts the United States in the third-place play-off tomorrow.
Argentina beat the United States 4-0 on Tuesday night, with the rout including a spectacular free-kick goal from Lionel Messi that saw him become the country’s leading scorer.