Barcelona secured the Spanish La Liga title for the first time since 2019 on Sunday.

The Catalan giants invested heavily last summer, sacrificing future income in order to bolster the squad and earn major silverware quickly.

Xavi Hernandez's side beat Real Madrid to win the Spanish Super Cup in January and clinched the league title by thrashing Espanyol 4-2 on Sunday.

AFP Sport looks at the key ways Barcelona were able to earn their 27th domestic championship.

Rock solid

Barcelona have been known over the years for their attacking flair, from Ronaldinho to Lionel Messi, but their triumph this season has been based on a mean defence.

The Blaugrana have conceded only 13 goals in 34 games, far fewer than any other side.

Andreas Christensen arrived on a free transfer from Chelsea and has slotted in perfectly, while his centre-back partner Ronald Araujo has staked his claim to be considered one of the best defenders in the world.

Xavi allowed young dynamo Alejandro Balde to phase out veteran left-back Jordi Alba and Jules Kounde has played out of position at right-back to cover for weakness in that area, creating a pacy backline.

It is no coincidence that Barcelona's Champions League elimination happened with many defenders injured, when Xavi was forced to pick now-retired Gerard Pique and Marcos Alonso at the heart of defence.

Goalkeeper Marc-Andre ter Stegen has found confidence and form again, with Barcelona yet to concede at home from open play all season, bar an Araujo own goal against Real Madrid.

The Catalans have kept 25 clean sheets so far this season, with the all-time league record 26, set by Deportivo La Coruna in 1993-94.

The Galician side and Atletico Madrid share the record for fewest goals conceded in a 38-game season, 18 -- a figure Barcelona could beat.

Lewandowski blitz

Barcelona signed Bayern Munich striker Robert Lewandowski as their marquee summer arrival and the Polish forward hit the ground running.

He is La Liga's top goalscorer with 21 goals,many of which came in a superb run of form before the World Cup.

The 34-year-old netted 13 goals in an 11-match spell between August and October to send Barcelona into the break as league leaders.

Lewandowski's double against Espanyol helped Barca seal their title triumph.

Consistency

Previous champions Real Madrid still consider themselves one of the very best sides in the world -- they are in the Champions League semi-finals and won the Copa del Rey earlier in May after all.

However Carlo Ancelotti's team could not keep up with Barcelona this season in what is known in Spain as "the competition of consistency".

Madrid smashed Barcelona 4-0 in the Copa del Rey semi-final second leg and on their day remain the country's best side, but Barcelona have proven more reliable more often, and opened up a vast points gap on their rivals.

Karim Benzema's injury-hit season set Madrid back and with ageing greats Luka Modric and Toni Kroos both key figures in their best 11, playing at the same high level in every game is hard to achieve.

Barcelona's Champions League and Europa League exits stung, but allowed Xavi's side to focus on conquering the top flight.

Extra midfielder

Despite Barcelona typically utilising a 4-3-3 system, in January Xavi decided to start deploying Gavi as a left winger.

The youngster would come inside and offer Barca a fourth man in the midfield, giving them a useful advantage to help keep possession.

With that system they waltzed to victory against Madrid in the Spanish Super Cup and went on a seven-match winning streak in La Liga.

It saw fewer chances created for Lewandowski, explaining his lower output in the second half of the season, but gave Barca far more control in games.

Big game shift

Under Barcelona's two prior coaches, Ronald Koeman and Quique Setien, they were unable to beat either of Spain's other two big sides, Real Madrid and Atletico, in La Liga. 

Xavi changed that, vanquishing both last season in his first few months in charge, and he managed it again this season.

The Catalans earned two wins over Atletico in the league and one against Real Madrid, as well as one loss.