Barcelona were crowned La Liga champions for the 25th time after beating Deportivo La Coruña 4-2 with the help of a hat-trick from Lionel Messi but while their coach Ernesto Valverde praised their consistency he acknowledged they have “lacked brilliance” at times.

Barça needed only a draw to clinch the title and complete an eighth domestic double after winning the King’s Cup last week and they marched into a 2-0 lead with goals from their record signing, Philippe Coutinho, and top scorer, Messi, in the first half. The result also relegated Deportivo.

Valverde said on marca.com: “When you chase it all season you say finally ‘the league is very long’. It is not decided only in a match. From the beginning we have been in the lead. In the end we were the best. The hard part is winning and winning.”

The former Athletic Bilbao coach added: “I have not invented anything, in the end these players have already won titles and leagues with other coaches. It’s more of them than the coach.

“We have been a competitive, compact team and we have overcome many difficulties, and in moments I know it has lacked brilliance.”

Depor were forced to push forward knowing only victory would be enough to keep their survival hopes alive and they paid the price as Messi added two late goals to complete the 46th hat-trick of his career.

The on-pitch celebrations were muted, perhaps out of respect for their dejected opponents, but Barça, who remain unbeaten in the league, could not be denied a seventh title in 10 seasons and Messi’s first goal was the pick of the bunch.

Ousmane Dembélé, the first player Barça bought after selling Neymar last summer, drove forward before playing in Luis Suárez, who clipped a cross with the outside of his foot that Messi met with a sidefooted volley.

Lucas Pérez pulled one back five minutes before half-time and the Turkish midfielder Emre Colak levelled for the Galicians from Celso Borges’ cross in the 64th minute. They then came close to finding a winner and becoming the first team to beat Barça in the league this season.

But Messi had other ideas, restoring Barça’s lead from close range in the 82nd minute before completing his treble with his 32nd league goal of the season.

That proved the ideal moment for the introduction of Andrés Iniesta at the end of a week where he emotionally announced he would be leaving the club after 22 years with them. Valverde’s side have 86 points from 34 games, 11 clear of second-placed Atlético Madrid, who have three games to play.