The Spanish giants had announced in the summer that Messi, 30, had committed his future to the club but the Argentine had not signed the new deal.
With his previous contract set to expire in 2018, Messi could have left Barca for free next summer had he not extended his deal.
"FC Barcelona and Lionel Messi signed today morning a new contract that will keep the Argentinian superstar at the club through the 2020/21 season," read a club statement. "The buyout clause was set at 700 million euros ($835 million)."
Pressure has been mounting on beleaguered Barca president Josep Maria Bartomeu to get Messi to put pen to paper.
Bartomeu was heavily criticised for his role in Neymar's departure and a haphazard search for replacements in the final weeks of the transfer window.
However, Bartomeu saw off a vote of no confidence measure launched by disgruntled fans thanks to Barca's fantastic start to the season, in large part inspired by Messi's form.
Messi's 30 trophies are along with teammate Andres Iniesta the most in Barca's history, including eight La Liga and four Champions League titles.
The diminutive Argentine, who joined Barca at the age of 13, has also smashed 523 goals in 602 games to become the Catalans' all-time top goalscorer.
News of Messi's renewal also comes as a huge boost to the La Liga leaders ahead of Sunday's top of the table clash at Valencia (1945GMT).
Barca lead a revitalised Valencia by four points, with both Real Madrid and Atletico Madrid a further six points adrift, thanks to a club record start of 11 wins and one draw from 12 games.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
