Announcing his decision at a press conference on the eve of Sweden’s final group game against Belgium, the 34-year-old added that he would not be taking part in the Rio Olympic soccer tournament in August as an over-age player.
Sweden must beat Belgium in Group E on Wednesday to have a realistic chance of qualifying for the round of 16.
Ibrahimovic, who has scored 62 goals in 115 appearances, had been giving routine answers about Wednesday’s game when he suddenly switched to English and said he had a message to send.
“The last game (at Euro 2016) will be my last for Sweden, so I hope it will not be tomorrow,” he said. “To finish with a disappointment — never.”
“I am very proud of what I have achieved and, wherever I go, I will always bring the Swedish flag with me. Disappointment doesn’t exist, only pride. I’m very grateful to all the supporters.”
Ibrahimovic, who has been reported to be set to join Manchester United in the English Premier League next season from Paris St Germain, has had a disappointing tournament so far.
He has not yet had a shot on target as Sweden have taken only one point from their opening two games.
Ibrahimovic, who made his debut in 2001 against the Faroe Islands, has played at the 2002 and 2006 World Cups and the last four European championships for Sweden.
However, he missed out on the last two World Cup tournaments in 2010 and 2014 when Sweden failed to qualify.
One of his most memorable international matches was a friendly in 2012 when he scored all four Sweden goals in a 4-2 win over England, including a memorable 35-metre effort with his back to goal.
“You need a whole press conference on what I think, but of course he has made a huge contribution to the Swedish national side,” said coach Erik Hamren.
“He has been such an important figure for Swedish football as a whole. He has been fantastic for the national team, for Sweden and I think we can talk about that for hours.
“We have one international player who is at the same level as Cristiano Ronaldo and Lionel Messi and that is Zlatan,” he added. “Zlatan is a huge character and he has really helped Swedish football.”