Barcelona have agreed to extend Lionel Messi's contract until 2018, when he will be 31. The Argentinian's previous deal ran until 2016 but negotiations have been swift and he has expressed a desire to see out his career at Camp Nou.

His formal buy-out clause remains at €250m (£203m) and his salary, which is heavily driven by incentives, is understood to begin at around €11m a year net.

Barcelona also announced that Xavi Hernández and Carles Puyol have renewed their contracts until 2016. Puyol's deal was due to run out at the end of this season while Xavi had two years left to run. Xavi is 32 and Puyol 34.Toni Freixa, the club's spokesman, said: "It just happened that an agreement they have was reached today just as it could have done on any other day. It is a coincidence, not a strategy."

Messi, who is in the running for a fourth world player of the year award, admitted a month ago that he had not yet talked to Barcelona about a new deal but that he did not anticipate there being any problems in renewing: his deal has been periodically updated since he made his first-team debut in October 2004. Messi's last contract was signed in September 2009 having been drawn up by the sporting director Txiki Beguiristain, who is now at Manchester City.

It was a complicated deal in which the Argentinian earned a basic salary of about €9.5m. Any bonuses earned in a season were then subsequently included in the basic salary from that moment on. Although full details have not yet been revealed, a similar formula has been used for this latest deal and the figures have not changed substantially. Barcelona's president, Sandro Rosell, is expected to answer questions on Wednesday and the three players will sign their deals over the coming week.

"Puyol, Messi and Xavi are three basic pillars and it was necessary that they continued to be attached to the club," said Freixa. "The board are extremely satisfied to be able to give a successful project continuity with the renewals of Xavi, Puyol and Messi." Puyol is the club captain while Xavi has played more games and won more trophies than anyone in Barcelona's history. Together they have won three European Cups, with Messi having scored a record 90 goals this calendar year.

Messi's deal comes as little surprise, even if negotiations were concluded quickly. Xavi's renewal had also been anticipated, although 2016 means that he will remain under contract until the age of 36. News of Puyol's deal is more unexpected. Negotiations had been going on for longer and his existing contract expires on 31 June. Other defenders signed deals before he had and progress appeared slower with the captain.

The most striking thing about Puyol's deal is its length. Having previously renewed on short-term deals, this time he has signed up for a further three years. He will be 38 when the deal expires. Puyol recently said: "I hope to keep playing until I am 40 but I do not want to be a burden."