(UPDATES with quotes)
Michael Phelps won his 18th Olympic gold medal in his final competitive appearance Saturday to help the United States to the 4x100 medley relay at the London Games.
Phelps' 22nd career Olympic medal was won in three minutes, 29.35 seconds, two seconds ahead of a strong Japan team.
"Tonight is the craziest night. I dreamt about this," said the 27-year-old Baltimore Bullet.
"Looking back at my career, I've seen that I've done what I wanted."
Phelps overturned an early Japanese lead on the second leg to put the Americans in the lead with a typically strong butterfly.
Matthew Grevers, Brendan Hansen and Nathan Adrian were his teammates.
A Japan team of Ryosuke Irie, Kosuke Kitijama, Takeshi Matsuda and Takuro Fujii claimed the silver in 3:31.26.
"We are very, very pleased," said Kitijama, who swam on the bronze-winning teams in Beijing and Athens.
"This medal continues a tradition that stretches back eight years. We have to be very proud."
The Australians, featuring Hayden Stoeckel, Christian Sprenger, Matt Targett, James Magnussen, clocked 3:31.58.
"It's been super tough but it definitely prepared me for meets in the future," Magnussen said.
It means Phelps' final medal chest contains 18 gold, two silver and two bronze.