Nathan Adrian won the 100 metres freestyle final at the London Olympics to become the first American to win gold in the blue-riband sprint for nearly a quarter of a century.

In a desperate finish, Adrian got his fingers on the wall 0.01 seconds, the smallest margin in Olympic swimming, ahead of Australian world champion James Magnussen.

Nathan stopped the clock at 47.52 seconds with Magnussen second in 47.53. Canada's Brent Hayden was third in 47.80.

Brazil's Cesar Cielo, the defending champion and reigning world record holder, was sixth in the race to decide the fastest man on water.

While the United States has been the dominant power in Olympic swimming, the last American man to win the 100 freestyle gold was Matt Biondi at Seoul in 1988.

Hungary's Daniel Gyurta broke the world record to win the 200 metres breaststroke gold medal, denying the host-nation Britain their first male swimming champion in almost a quarter of a century.

Propelled by a deafening roar inside London's Aquatic Centre, Gyurta held on to beat Michael Jamieson in a desperate finish to win in a time of two minutes 07.28 seconds.

Gyurta shaved 0.03 off the previous world record set by Australia's Christian Sprenger at the 2009 world championships in Rome when the now-banned polyurethane bodysuits were still allowed.

Scottish-born Jamieson was second in 2:07.43 after almost drawing level with Gyurta approaching the wall while Japan's Ryo Tateishi, swimming in the outside lane, was third in 2:08.29.

His countryman Kosuke Kitajima, the two-time defending champion, finished fourth, dashing his hopes of becoming the first male swimmer to win the same event at three successive Olympics.

China's Jiao Liuyang stormed home on the last lap to win the women's 200 metres butterfly gold medal, in the process beating the compatriot who relegated her to silver four years ago.

Jiao was second when she turned for home but surged clear of her rivals to win in a time of two minutes 04.06 seconds, an Olympic record, adding a gold medal to the world title she won last year.

Spain's Mireia Belmonte, who is competing in six events in London, held on to take silver and Spain's first medal of the Games after leading with one lap to go.

"I feel very content and emotional," said Belmonte. “When asked if she expected to finish second, she replied: "No! It was very difficult."

Natsumi Hoshi of Japan took bronze.

Jiao, tears rolling down her face as she collected her gold, had a reputation in her homeland for always being the runner-up. In Beijing four years ago she took silver after Liu Zige, who holds the world record of 2:01:81 for the event, got gold.

Liu, who had said after the heats that she did not feel on top form, finished eighth.

And the United States won the women's 4x200 metres freestyle gold medal after a brilliant anchor leg from Allison Schmitt.

Missy Franklin, Dana Vollmer, Shannon Vreeland and Schmitt won in a combined time of seven minutes, 42.92 seconds, ahead of Australia and France.

Australia led after the second and third changeovers but Schmitt, who won the individual 200 freestyle final, took the lead and surged away to win.

Schmitt, Franklin and Vollmer all collected their second golds in London after Franklin won the 100 backstroke and Vollmer the 100 butterfly.

Meanwhile, Rebecca Soni of the United States broke the women's 200 metres breaststroke in the semi-finals.

Soni clocked two minutes, 20.00 seconds to break the 2:20.12 set by Canada's Annamay Pierse at the world championships in Rome in 2009.