“It’s what I always dreamed and what I always wanted,” he said.
The 29-year-old Argentina international joined Barcelona aged 13, made his first-team debut at 17 and has scored more than 500 goals for the club.
He has won La Liga eight times with Barca, the Champions League four times and Ballon d’Or world player of the year title five times.
Last season under coach Luis Enrique, Barcelona were second in La Liga, three points behind champions Real Madrid and lost 3-0 on aggregate in the Champions League quarter-finals to eventual beaten finalists Juventus.
Enrique announced in March that he would leave the club in the summer after three years in charge and his final match saw Barca capture the Copa del Rey trophy.
Messi scored the opening goal as they beat Alaves 3-0 to win the competition for a third successive season.
Messi, who was runner-up to Real’s Cristiano Ronaldo in the Ballon d’Or, told the Barcelona website his goal is “to try to improve each season in regards to the last, and that is the aim for next season”.
In an interview with a radio station in Spain, Lionel Messi congratulated Real’s Cristiano Ronaldo and he acknowledged him as one of the world best.
In Messi’s words, he said there was no rivalry between them as the media and fans portray. Messi said they have a great relationship and that each season, they both put in their best for their teams.