Zlatan Ibrahimovic's international career ended in a damp squib when Sweden lost 1-0 to Belgium in their final Euro 2016 Group E match on Wednesday and failed to reach the last 16.
Radja Nainggolan's fine shot after 84 minutes sent Belgium into the knockout stages and a game against Hungary as they finished second in the standings, level on six points with group winners Italy.
The Swedes ended bottom on one point and Ibrahimovic's bold promise that he would never finish with a disappointment proved to be mistaken.
He tried in vain to inspire his team and had a second-half effort ruled out for offside but Belgium, without ever producing their most fluent football, had enough quality to deal with Sweden's sporadic attacks and create enough attacking moves.
Sweden started brightly and Marcus Berg's fierce snap shot was parried away by Belgium goalkeeper Thibaut Courtois.
Belgium responded with a surging run by midfielder Kevin de Bruyne that set up Romelu Lukaku for a shot just wide and a mazy dribble across the edge of the area by Eden Hazard ended with a De Bruyne strike on goal.
Ibrahimovic sprung into life with a shot just past the post but it was a rare attacking moment for Sweden who were pushed deep by the strong-running Belgian midfield.
De Bruyne whipped in two dangerous crosses from the left and from one of them Thomas Meunier flashed a header narrowly wide just before halftime.
Sweden enjoyed a good spell of possession after the interval and Ibrahimovic hooked the ball into the net from close range but the effort was ruled out for offside.
De Bruyne tested goalkeeper Andreas Isaksson with a fierce long-range strike and after Sweden cleared another dangerous cross the ball fell to Nainggolan whose rasping 20-metre shot flew into the top corner of the net.
Ibrahimovic threw the ball away in frustration as the Belgian players celebrated and Sweden's talismanic captain cut a forlorn figure after the final whistle as he slowly walked over to applaud his team's yellow-clad fans.
"I’m very disappointed," Sweden coach Erik Hamren said.
"We were talking before the game about the honour of representing Sweden and of being here but I couldn’t have asked for much more from my players. I’m proud of them, even though we lost."
Euro: Ireland make history, enter last 16 after late Brady goal
PIX: Flying tackles, bloodied noses, coaches kisses and more at Euro
IOC discusses more crackdowns on drugs cheats before Olympics
Ibrahimovic to retire from international football after Euro 2016
Serie A: Totti plays 600th league game as Roma go second