They ended their disappointing 2019/2020 campaign on a high with a resounding 5-0 win at Alaves.
Barca finished the season second in the standings on 82 points, five points behind newly-crowned champions Real Madrid who drew 2-2 at Leganes later on Sunday.
Alaves came 16th on 39.
Teenage forward Ansu Fati put Barca in front midway through the first half after the visitors hit the woodwork three times.
Messi and strike partner Luis Suarez further stretched their side’s lead before half-time.
Defender Nelson Semedo hit the fourth early in the second half before Messi struck again, to end the campaign on 25 league goals.
The Argentina captain had four more goals than second top scorer Karim Benzema of Real Madrid.
Messi, who also finished as top marksman for a fourth consecutive season, eclipsed the benchmark he previously shared with the late Telmo Zarra.
But he said he would have rather have won the league.
“Individual prizes and objectives are secondary. It’s an important achievement to win it seven times, but I would have liked it to have been accompanied by the La Liga title,” Messi said.
Barca’s captain had made headlines on Thursday following his angry post-match interview after the 2-1 loss to Osasuna, blasting the team as weak and inconsistent.
He also appeared to criticise the running of the club.
But he was in a happier mood after the dominant performance against Alaves.
He said the team felt more confident ahead of next month’s UEFA Champions League last 16 second leg game with Napoli, which they host with the score tied at 1-1.
“Today we saw something else. It was a difficult game due to the situation we were in and the kick-off time and heat.
“But the team responded with a different attitude and showed great commitment,” Messi added.
“We took a long hard look at ourselves from the inside, which is what we needed to do. We have not had a good season in terms of performances or results, but today we took a step forward.
“It’s an important step for what’s coming next.”(Reuters/NAN)