Lionel Messi is in search of a new team. (Scott Bales/YCJ Photo)

Lionel Messi won’t be returning to Barcelona, after all.

The La Liga club announced Thursday that the Argentina legend will leave the team after financial problems prevented it from agreeing on a new contract with the forward.

On July 14, it was reported that Messi was about to sign a five-year deal with Barcelona, even though he will take a significant cut in salary.

That, however, is history on Aug. 5.

Messi, 34, has been a free agent since his contract expired June 30.

Barcelona has had problems registering Messi’s new contract with the league while complying with the league’s financial fair play rules.

Where Messi goes from here is anyone’s guess.

Here is a statement by Barcelona:

“Despite FC Barcelona and Lionel Messi having reached an agreement and the clear intention of both parties to sign a new contract today, this cannot happen because of Spanish LaLiga regulations on player registration.

“As a result of this situation, Messi shall not be staying on at FC Barcelona. Both parties deeply regret that the wishes of the player and the club will ultimately not be fulfilled.

“FC Barcelona wholeheartedly expresses its gratitude to the player for his contribution to the aggrandisement of the club and wishes him all the very best for the future in his personal and professional life.”

Messi is Barca’s all-time leading goal-scorer (672 goals in 778 games). He found the net 38 times in 47 games in 2020-21, but that was considered a down year for the Argentine.

While winning 10 La Liga and four UEFA Champions League titles with Barcelona, the 33-year-old Messi finally won a major international last month, helping Argentina over host Brazil in the Copa America final.

For Argentina, Messi has recorded 76 goals in 151 matches.