The Roma midfielder, reportedly wanted by Chelsea, controlled a cross from Eden Hazard outside the area and powered it into the net in the 82nd minute. Belgium now take on Hungary in Toulouse on June 26.
Sweden finished third in the group and will look back with regret on a flat performance in their opener against Ireland.
Facing elimination if defeated, both teams pushed forward to attack which produced a pulsating first half hour in balmy Nice.
Playing in unfamiliar turquoise jerseys, Belgium launched regular raids with Kevin De Bruyne through the middle and Hazard, roving from wing to wing, at the heart of the danger.
More From This Section
Midway through the half, a backheel from Hazard let the Man City star fire a shot straight at the Isaksson.
Another surging De Bruyne run forced a yellow card for Albin Ekdal after a last-ditch trip on the Man City star, while twice in five minutes he drilled dangerous crosses across the goalmouth.
At the other end, Ibrahimovic had little joy, bar the occasional half-chance snapshot or attempt at a spectacular volley.
But none came to anything on an ultimately frustrating night for the Swedish legend who announced his international retirement ater Euro 2016 on Tuesday.
It was Belgium who nearly entered the break in front, when Meurier headed an inch-perfect De Bruyne cross just wide of Andreas Isaksson's post.
As the clock ran down in the second half the temperature began rising again.
With fifteen minutes to go Belgium nearly made a breakthrough when a powerful Lukaku break was foiled by Isakksson who spread his body well to the shot.
A minute later, an identical run by the Everton striker, this time with a neat finish, was ruled offside.
Time was running out on Ibrahimovic when he went close with a freekick turned away by Courtois with a quarter hour to go.
Then a header was cleared off the line by Meunier.