Messi follows in the footsteps of fellow club stalwarts Xavi and Carles Puyol, both of whom signed their extensions last month.
Barca defender Jordi Alba is delighted Messi, who will be 31 when his new deal expires, has committed his long-term future to the club.
"I can't imagine what Messi will be like in 2018, but it's great news for Barca fans that he's staying," said the Spain international today.
"He is the best player in the world and as long as nothing happens, he'll be the best ever. We'll try to make him feel as comfortable here as we can."