Lionel Messi has signed a new deal to stay at Barcelona until 2021, with the Catalan giants inserting a €700 million (US$835 million) buyout clause into the terms.

Barca said in July that Messi had agreed to a contract until June 2021, which would be signed "in the coming weeks".

The lack of confirmation on that agreement had led to talk that Messi could leave Camp Nou, with the Argentina superstar reportedly the subject of an audacious bid from Manchester City for his services.

However, Barca president Josep Maria Bartomeu said earlier this month that Messi had signed three different deals – agreements with his Messi Foundation and one relating to image rights to run alongside the contract of employment – to cement his long-term future at the club.