By Steve Keating

VANCOUVER (Reuters) - A World Cup that kicked off amidst one of the biggest scandals in soccer history ended in joyous celebration on Sunday as the United States defeated Japan 5-2 in a free-wheeling clash that offered some hope of better days ahead for the so-called Beautiful Game.

The troubles that have rocked the sport's governing body FIFA for more than a month seemed a world away as golden confetti rained down on a capacity crowd of over 53,000 at BC Place following an entertaining contest that showcased the good in a sport some had started to believe was rotten to the core.

The U.S. returned to the pinnacle of women's soccer with a dominating display to cap a riveting tournament that pushed the sport into new territory.

The Americans last triumphed in 1999 but women's soccer is a vastly different game than it was a decade-and-a-half ago with new nations forging their way into the elite and triggering unprecedented global interest in the tournament.

Despite corruption scandals swirling around FIFA and a lawsuit filed by leading players against organizers for being forced to play on artificial turf, the tournament ended in triumphant fashion, smashing worldwide television ratings and attracting an eye-popping total attendance of 1.35 million spectators.

Since the World Cup began on June 6 in Edmonton, the tournament had been waiting for the arrival of a star and on the final game she finally arrived, American captain Carli Lloyd grabbing the spotlight with an stunning three-goal masterclass that laid the foundation for the U.S. victory.

As Golden Ball winner Lloyd demonstrated with her astonishing 13 minute hat-trick, that included a goal from the half-way line, the women's game is delivering a level of excitement and quality beyond previous standards.

"We always say that every women's World Cup is special and another milestone in the development of women's soccer and I truly believe that this seventh edition of FIFA women's World Cup Canada has made history in many ways," said Tatjana Haenni, the FIFA deputy director of the competitions division and head of women’s soccer.

Certainly, the U.S. made history by becoming the first nation to win three World Cups while Lloyd rewrote the individual record books.

The attacking midfielder's hat-trick was the first by any player in a women's World Cup final. In fact, no team had ever scored more than two goals but the 32-year-old Lloyd went one better all by herself.

After losing to Japan on penalties in the 2011 final, the Americans were quick to seize control this time, scoring four times in the opening 16 minutes and leading 4-1 at halftime.

Japan continued to push forward after the break and did pull one back, but had simply left themselves too much to do against an American side that had conceded just one goal en route to the final.

"I will tell you this, I never doubted it," said American goalkeeper Hope Solo, who was awarded the Golden Glove as the best keeper of the tournament.

"I knew it wasn't going to be easy, but I didn't have any doubt. We didn't sit back and think it was our destiny and that it was going to come to us.

"It's been heartbreaking at times, it's been emotional, it's been a struggle, but we never took our eyes off the prize, not four years ago, not 16 years ago."

As the crowd, that included U.S. vice-president Joe Biden and Canadian Prime Minister Stephen Harper stood and cheered, all seemed right in the soccer world.

But there was a stark reminder of more possible turbulence ahead as loud boos echoed through the stadium when it was announced FIFA vice-president Issa Hayatou would present the trophy.

Normally that task falls to embattled FIFA president Sepp Blatter but he opted not to come following corruption investigations by U.S. and Swiss authorities which include scrutiny of how FIFA awarded World Cup hosting rights to Russia and Qatar for the 2018 and 2022 men's tournaments.

Blatter has not been accused of any wrongdoing, but has retained an attorney and while he was absent from Sunday's final, like the rest of the soccer world, his attention was diverted back to the events on the pitch.

"A #FIFAWWC hat-trick for the #USA. Congratulations on becoming the 1st team to win 3 Women's World Cups @ussoccer_wnt." he tweeted.

(Editing by Julian Linden)