1hr 57min 38.2sec.
Hungary's Eva Risztov celebrates winning the women's 10km marathon at the London Olympic Games. Reuters/Dominic Ebenbichler
Italy's Martina Grimaldi took bronze and home favourite Keri-Anne Payne was fourth, with the top four separated by just four seconds.
Risztov, 26, competed in the pool at the 2000 and 2004 Olympics before retiring in 2005, only to return to the sport as a marathon specialist in 2009.
She succeeded Russia's Larisa Ilchenko, who won the inaugural women's event in Beijing four years ago but was not competing in London.
Britain's Payne, a silver medallist in Beijing, was bidding to win a first swimming gold medal of the Games for the host nation but finished off the podium.
The event began beneath bright sunshine, with hats and sun block the order of the day as a huge crowd descended upon Hyde Park to cheer on Payne.
Risztov led after completing the first 1.7km lap in 19min 22.2sec, with Australia's Melissa Gorman and Payne in close pursuit.
Gorman pulled ahead of Risztov at the start of the second lap, but it was Anderson who began the third lap in the lead, 1.6sec ahead of Payne and 1.9sec clear of Risztov.
At the halfway stage, with the sun beating down on the 24 swimmers as they churned through the dark, still water, Risztov and Grimaldi had moved in front of Anderson, with Payne slipping to fourth.
South Africa's Jessica Roux and Brazilian Poliana Okimoto both had to withdraw due to fatigue but the pack swam on, with Risztov leading the field into the final circuit of the lake.
A group of five swimmers -- Risztov, Grimaldi, Anderson, Germany's Angela Maurer and Payne -- had broken clear, and they put 20 metres of water between themselves and the rest as the race entered the last 1,000 metres.
Risztov made a bold early kick for home and held off a determined last-gasp charge from Anderson to slap the board above the finishing line first.