Paris Saint-Germain announced that Lionel Messi would leave the club after their season's final match on Saturday.
"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 club said the 35-year-old would play some role in the Ligue 1 match against Clermont at the Parc des Princes on Saturday.
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 has won the Ballon d'Or seven times and 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, he could not lead PSG past Bayern in the Champions League.
Some supporters even jeered Messi at the Parc des Princes despite scoring 32 goals in 74 games for PSG before Saturday's final match.
His relationship with the club soured earlier this season when he skipped training for an unauthorized trip to Saudi Arabia to fulfill 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 knowledgeable about the Saudi negotiations told AFP last month that it was a "done deal" for him to play in the Saudi Arabian league. However, Messi's father, Jorge, denied that his son had decided on his next destination.
Inter Miami have also reportedly made an offer to take him to Major League Soccer.
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 football history," said PSG boss Christophe Galtier this week.
"This year, he has been an important part of the team. I have never thought that his criticism was justified 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."