DOHA, Qatar (AP)When it comes to soccer, money can buy the world.

It can pay for the World Cup. And the world’s best players. And it can bundle them all up into a perfect package and present it to a global audience of millions.

The power of money was on full display in the Qatari city of Lusail on Sunday as Argentina beat France 4-2 on penalties to become world champion for the third time and end Lionel Messi’s pursuit of the one major trophy that had eluded him in his storied career.

One of the most thrilling finals in the tournament’s 92-year history finished 3-3 through extra time, with Messi scoring twice and Kylian Mbappe completing a hat trick.

”The match was completely insane,” Argentina coach Lionel Scaloni said afterwards. ”I know it’s just a football game, a World Cup, and we shouldn’t think any further, but in Argentina, football is not just football. We have to celebrate.”

In the end it was not a bad return for Qatar, which spent an estimated $200 billion on staging soccer’s most prestigious event.

Hundreds of millions more have been paid out to take superstars Messi and Mbappe to Qatari-owned Paris Saint-Germain.

And here, on the sport’s biggest stage of all, was the perfect finale as far as the oil-and-gas rich Emirate was concerned.

On a temporary stage in the middle of the field, Qatar’s emir, Sheikh Tamim bin Hamad Al Thani, gave Messi a Qatari ceremonial robe to wear over his Argentina shirt for the traditional World Cup trophy lift.

Messi was beaming with pride as he tenderly kissed the cup of solid gold. But it is arguably the host country that could consider itself the biggest winner after a tournament that appeared to demonstrate the effectiveness of so-called sportswashing.

After widespread criticism about its human rights record and treatment of migrant workers leading up to the event, the focus switched to soccer as the tournament progressed. By Sunday’s final, the narrative was fixed on Messi’s mission to emulate Argentina great Diego Maradona by leading his country to a World Cup title.

The subplot was France’s bid to become the first team to win the trophy back-to-back since Brazil and Pele in 1958 and ’62.

”It was always inevitable that the conversation would increasingly turn to football once the tournament started, but human rights questions have never gone away and will continue to be raised long after the tournament,” Steve Cockburn, head of economic and social justice at Amnesty International, told The Associated Press.

Amnesty says thousands of migrant workers have died ”suddenly and unexpectedly” in Qatar over the past decade.

Last month Hassan al-Thawadi, the secretary-general of Qatar’s Supreme Committee for Delivery and Legacy, said between 400 and 500 had died during construction for the tournament. The committee later said he was referring to work-related deaths from 2014-2020, not specifically for the World Cup.

Soccer’s governing body FIFA has been pressured to provide answers on a proposed compensation fund for those affected and the concept of a migrant workers center to be created in Doha.

Progress on both of those issues remains unclear.

”Qatar wants to be a hub for global sporting and cultural events, and so should know that scrutiny will continue,” Cockburn said. ”Hosting the World Cup has brought far more attention on the treatment of migrant workers in Qatar and the rest of the Gulf than would otherwise have been the case, as well as the responsibility of sporting bodies such as FIFA.”

Concerns were also raised over the safety and wellbeing of fans from the LGBTQ+ community ahead of the tournament because homosexuality is a criminal offense in Qatar.

Captains of seven European nations, including England and Germany, planned to wear multicolored ”One Love” armbands to promote inclusion and diversity. But they ultimately backed down when FIFA threatened to issue yellow cards to the players involved, saying it was a contravention of its regulations.

It is unclear whether that decision was taken under pressure from the Qatari government, but it added to the sense that the conservative Muslim country was hosting the World Cup on its own terms.

There was also a sudden ban on beer sales at stadiums two days before the opening match, which was a U-turn on the deal Qatar made to secure the tournament.

The term sportswashing is widely used in reference to countries or organizations trying to use sports to repair reputational damage.

And the World Cup deflected attention from off-field issues by producing some remarkable stories on it.

Saudi Arabia provided arguably the biggest shock in the tournament’s 92-year history by beating Argentina in their opening group-stage match.

Morocco became the first African country to make it through to the semifinals and sparked an outpouring of pride across the Arab world.

”For me, football makes people dream and children in particular,” Morocco coach Walid Regragui said. ”In Morocco and Africa, we have kept those dreams alive.”

Perhaps predictably, FIFA president Gianni Infantino described it as the ”best World Cup ever.”

However, he is not the only one to speak about it in positive terms.

”Qatar have won a lot of friends because of this World Cup and the way it has been handled,” said David Dein, the international president of England’s bids for the 2018 and ’22 World Cups.

He attended more than 50 games during the tournament and believes the experience will inspire real change in Qatar.

”They’ve been very open-minded to it,” he added. ”I think Qatar will benefit from this going forward. I hope so. That should be a legacy for them.”

It is certainly easy to see the immediate benefit.

Qatar will forever be associated with Messi after he finally won the World Cup and further strengthened his case to be considered the greatest player of all time.

”It took so long, but here it is,” Messi said. ”Obviously, I wanted to complete my career with this, (I) can’t ask for more.”

At 35, Messi was the story of what is likely his last World Cup, and the narrative became more compelling with every win, every goal and every assist that provided flashes of the brilliance he produced with more regularity during his peak years.

That the final developed into a personal duel between him and PSG teammate Mbappe added another thread to a captivating contest.

Mbappe is the natural heir to Messi and Cristiano Ronaldo as soccer’s next superstar and he scored the fist hat trick in a World Cup final in 56 years.

He was also the tournament’s leading scorer with eight goals, ensuring another of Qatar’s great investments was on the podium to collect a trophy in the end.

But the enduring image of a World Cup was one of the world’s greatest ever players, in traditional Qatari dress, lifting the sport’s biggest prize of all.

James Robson is at https://twitter.com/jamesalanrobson

AP World Cup coverage: https://apnews.com/hub/world-cup and https://twitter.com/AP-Sports

James Robson is at https://twitter.com/jamesalanrobson

AP World Cup coverage: https://apnews.com/hub/world-cup and https://twitter.com/AP-Sports