Lionel Messi has ended speculation about his future by signing a new contract with Barcelona until 2021.
Messi's previous deal had been due to expire at the end of the season.
Barca announced the news in an official club statement, which read: "FC Barcelona and Lionel Messi signed on Saturday morning a new contract that will keep the Argentinian superstar at the Club through the 2020/21 season.
"The buyout clause was set at €700m. Thus, by the time the new deal expires, the 30-year-old striker will have spent 17 years with the first team."
Messi avoided the chance to clear up the doubts about his Barcelona contract situation as he accepted the European Golden Shoe award on Friday.
Barcelona had already announced that Messi had agreed to a new deal until 2021 in July but the forward had not yet signed the contract himself.
Messi, who made his senior debut as a 16-year-old in a friendly against Porto, has eight La Liga titles, four Champions League wins and five Copa del Rey wins among his list of honours.
He arrived at Barca from Newell's Old Boys as a teenager in 2000 and made his first competitive appearance against Espanyol as a 17-year-old.
Messi scored the first of his club record 523 goals -- they have come in just 602 matches -- against Albacete in May 2005 and has since claimed the Ballon d'Or on five occasions, more than any other player.