BARCELONA, Spain (AP) — Spain beat Australia 8-6 Friday to become the first host country to be crowned world champion in women's water polo.

Spain, which won the silver medal at the 2012 Olympics, never trailed at Barcelona's Bernat Picornell pool in front of their raucous home fans.

It was Spain's first gold medal and 11th in total at the worlds.

Spain was led by captain Jennifer Pareja, who scored two goals including a late penalty to clinch the title.

"I'm flipping out, I'm so happy," said Pareja. "This is possibly, no, not possibly, this is the best moment of my sporting life. The final in London was incredible, but when you win and are world champion it's beyond incredible."

Australia, the bronze medalist from the London Games, was undefeated going into the final but never got closer than down 4-3 in the second quarter.

Earlier, Hungary claimed the bronze after beating Russia 10-8.

Spain got going with a goal by center forward Maria Godoy and went into halftime with a 5-3 lead after driver Roser Tarrago scored with a long shot with the shot clock winding down.

"Winning in front of 4,000 people is indescribable," said Tarrago. "That support made us push hard to win. We could not lose again in the finals like the Olympics."

Spain beat Olympic champion United States in the quarterfinals and Hungary in the semifinals.

Pareja won Spain's third sprint of the night to start the second half, and moments later teammate Laura Lopez fired in her second goal.

Australia tightened up its defense and managed to enter the final period trailing 6-4 thanks to a goal by Ashleigh Southern.

But Pareja scored a penalty with a little more than five minutes to go to build an insurmountable 8-5 advantage, which goalkeeper Laura Ester ensured by saving a penalty for Australia.

The Spanish team and fans began celebrating during an Australian timeout with 12 seconds to go, and then dove into the pool with their coaching staff after the final whistle.