With his previous contract set to expire in 2016, Messi will now remain at Barcelona until June 2018.
The 25-year-old forward joined Barcelona when he was 13, and debuted with the first team three years later. He has gone on to become Barcelona's all-time leading scorer en route to helping the team lift numerous trophies and winning four FIFA world player of the year awards.
"I'm very happy at Barcelona, I have always said so. It's a great day," said Messi, who is now set to remain a Barcelona player until he is 31 years old.
"I don't know how I will be when I reach 31. I just go forward day by day and try to enjoy playing football here," he said.
Barcelona first announced in December that Messi, along with midfielder Xavi Hernandez and defender Carles Puyol, had agreed to extend their contracts.
Messi said that he wanted to play for Barcelona until possibly ending his career back in his native Argentina.
"I have said before that as far as Europe goes I would like to end my career at Barcelona," he said. "I don't think about playing for any other team on the continent. That said, I don't rule out ending my playing career in Argentina."