Messi, who recently won his fourth consecutive FIFA Ballon d'Or was the sport's player of the year, will reportedly be paid about $15 million a year under the contract.
The team announced the signing on its website, pointing out that Messi, 25, debuted with Barcelona when he was 16 and will be 31 when the contract expires.
Messi was credited with a record 91 goals for Barcelona and the Argentine national team in 2012. He already has eight goals in five games in 2013 as Barcelona has built a large lead in La Liga.
Aaron Carter is still in love with Hilary Duff
NBC reportedly holds celebs hostage to Jimmy Fallon's show