"The deal will be signed in the coming weeks, when Messi returns to the team for pre-season training," said the club in a statement.
"The club is very happy with both the renewal and the commitment of Messi, the best player in history, who has played his full professional career at Barca and has led the team to an era of extraordinary success, the likes of which has never been seen in world football."
Messi, currently on honeymoon, joined Barcelona's famed La Masia academy at the age of 13, moving from hometown club Newell's Old Boys in the city of Rosario.
In the ensuing 17 years, the forward has gone on to become the club's all-time record goalscorer, registering 507 goals in 583 matches since making his debut in 2004.
The Argentine superstar is also the highest goalscorer in La Liga history with 349 goals.
Messi's new contract, reportedly worth £500,000 ($645,000) a week, ties him to the club until he is 34 and will see him attempt to add to the 30 trophies he has won with Barcelona.
He will sign the contract in the coming weeks, once he has returned from the Caribbean with his wife.
Barcelona added that Messi is" in one of the best moments of his career."
The club added: "[He] still has a lot more left to give, which is music to the ears of all Barca fans who will get to continue marveling at his greatness for at least another four years."