RIO DE JANEIRO (Reuters) - Seventeen nations split the 30 sailing medals awarded at the 2016 Olympic regatta that began with concerns about polluted waters and ended with medal winners jumping into Guanabara Bay to celebrate.

During what sailors said was one of the most challenging competitions in Olympic history, Britain and the Netherlands led the hunt for gold with two each.

Australia and New Zealand led the total medals count with four medals apiece and the 10 golds were divided among eight different countries.

The United States, who have one of the most storied Olympic records, continued a string of weak Games performances by winning a single bronze in the Finn class. Croatia, a country that had never won a sailing medal, won two, a gold in the men's 470 and a silver in the men's Laser.

The fluky winds and confusing currents of Guanabara Bay and the high winds and large and sometimes freakish waves of the open ocean courses threw up a wide range of sailing conditions and many favorites struggled to perform consistently enough to reach the podium.

However, organizers felt themselves vindicated after making the controversial choice to hold the competition in the heart of Rio on Guanabara Bay despite its sewage and rubbish problems rather than in the cleaner waters and more consistent conditions of Buzios, a beach resort three hours to the north.

They even got a story-book finish in the final race as Brazil's women's 49erFX team edged out New Zealand by two seconds to win the gold in front of their home crowd.

"I think we can say that racing has been spectacular," said Malcolm Page, a two-time gold medallist and the head of media for World Sailing, the sport's governing body.