BARCELONA, Spain -- Hungary beat Montenegro 8-7 on Saturday for its third world men's water polo title.
Hungary never trailed but needed Marton Szivos' goal with less than 2 minutes to play and a save by goalkeeper Viktor Nagy in the final seconds to wrap up the gold medal.
Hungary's previous two gold medals at the world championships came in 1973 and then in 2003 at the same Bernat Picornell pool.
The silver was Montenegro's first medal in men's water polo competing as an independent nation after gaining independence from Serbia in 2006. In 2005, competing as Serbia and Montenegro, it beat Hungary for the gold.
Earlier, Croatia claimed the bronze by defeating Italy 10-8.
Montenegro enjoyed more vocal support from their fans with their thunderous national anthem, flags and songs, but it did little to help its hapless attack in the opening stage.
Hungary's Nagy turned back the first five shots to reach him in the first period, which ended with his team up 2-0 thanks to a no-look shot by center forward Balazs Harai to sweep the ball home.
Harai knocked in a lobbed pass to increase the lead to 3-0 before Darko Brguljan scored Montenegro's first goal with 3:07 to go before halftime.
On the scoreboard, Montenegro built momentum when goalkeeper Milos Scepanovic blocked a penalty and seconds later Aleksandar Ivovic beat Nagy to close the gap to 3-2 going into the third quarter.
After the stingy opening 16 minutes, both teams' attacks got rolling following the halftime break.
Hungary held a slim one-point advantage heading into the final quarter, but Ivovic scored a game-high third goal to tie it at 7-7 with 2:04 remaining. The center back finished as the competition's joint-leading scorer with 20 goals.
Szivos tapped in a pass near the goal to net the title-clinching goal, which Nagy then made good by blocking Montenegro's last-gasp try.
Nagy was voted the best goalkeeper of the tournament.
Besides its three world titles, Hungary is the most successful nation in men's water polo at the Olympics with nine gold medals, including three straight from 2000, 2004 and 2008.
Only one of the eight meetings between Hungary and Montenegro has been decided by more than one goal: Hungary's 11-9 win at the 2008 Olympics.
On Friday, Spain won the women's title by beating Australia.