The United States gave Hall of Famer Mia Hamm the perfect send-off on Thursday, beating Brazil 2-1 to win Olympic gold in the women's football tournament.
World champions Germany edged past Sweden 1-0 in a repeat of the 2003 World Cup final to take a second successive bronze.
Abby Wambach powered home a header in the 22nd minute of extra-time in Athens to give the U.S. their second Olympic title after winning at the 1996 Atlanta Games.
For Hamm, widely regarded as the best female player in the world, it was a fitting end to a glittering 17-year career, even though she made little impact on a disappointing game.
The Americans, who finished runners-up to Norway in Sydney four years ago, took the lead six minutes before halftime through a superb long-distance strike from Lindsay Tarpley.
Brazil striker Pretinha equalised in the 73rd minute, pouncing on a mistake from goalkeeper Briana Scurry to score from close range.
But Wambach settled American nerves in the second period of extra-time, the big striker heading a Kristine Lilly corner into the roof of the net for her 18th goal in her last 20 games.
The 32-year-old Hamm, who helped the U.S. win the World Cup in 1991 and 1999, never came close to scoring her 154th goal in 266 internationals.
But she was cheered every time she touched the ball by a raucous crowd of 10,000 that included Olympic swimming champion Michael Phelps.
Earlier, midfielder Renate Lingor scored a 17th-minute winner for Germany against Sweden in an absorbing bronze medal match.
However, the victors were indebted to goalkeeper Silke Rottenberg, who provided an Oliver Kahn-type presence for the Germans, also bronze medallists in Sydney four years ago.
Rottenberg made several brave stops to deny Sweden at Karaiskaki Stadium, the home of Greek club Olympiakos.
"I don't think Germany were better than us at all," said disgusted Swedish striker Victoria Svensson. "I hate losing to Germany, I'm sick of it."