Lionel Messi is leaving Paris Saint-Germain after their final match of the season on Saturday, the Ligue 1 champions said on social media.
"After two seasons in the capital, Leo Messi's adventure with Paris Saint-Germain will come to a conclusion at the end of the 2022-23 season," the club said in a widely expected announcement.
The Argentinian was signed two seasons ago from Barcelona to help PSG win an elusive Champions League, but he failed in that aim.
The French club were beaten in the Champions League last 16 by Real Madrid last season and suffered the same fate this year at Bayern Munich's hands.
Messi, who has won the Ballon d'Or seven times, has earned an estimated annual salary of 30 million euros ($32.1 million) after tax at Qatar-backed PSG.
He led Argentina to victory against France in the World Cup final in Qatar in December.
But having poured his efforts into that long-awaited triumph for his country, his was unable to lead PSG past Bayern in the Champions League.
His relationship with the club soured further earlier this season when he skipped training for an unauthorised trip to Saudi Arabia to fulfil his commitments as a tourism ambassador for the Gulf state.
A one-week suspension followed, and there was no prospect of Messi signing a new deal in Paris after that.
Barcelona, the club where he has played most of his career, would love him to return but the possibility has appeared to be fading in recent weeks.
Instead, Saudi Arabia might be his next destination.
A source with knowledge of the Saudi negotiations told AFP last month that it was a "done deal" for him to play in the Saudi league, although Messi's father Jorge denied then that his son had decided his next destination.
Inter Miami have also reportedly made an offer to take him to Major League Soccer.
- 'Best player in history' -
After all he won at Barcelona, and his World Cup triumph with Argentina, the French league may not mean that much to Messi when he looks back on his career.
As journalist Vincent Deluc noted in France's leading sports daily L'Equipe: "PSG have not been better than they were before because of him... and he seemed to have as much desire to play in Ligue 1 as he did to go to the dentist."
Nevertheless, Messi has still left his mark on those who have worked with him and come up against him.
He was nominated for this season's French player of the year prize, even if he missed out on the award to PSG forward Kylian Mbappe.
"I have had the privilege to coach the best player in the history of football," said PSG boss Christophe Galtier this week.
"This year he has been an important part of the team. I have never thought that the criticism of him was justified at all, when he is 35 and there is a World Cup in the middle of the season and yet I think he has scored or set up more than 40 goals in all competitions.
"It has been a great privilege not to coach him but to accompany him throughout the season."