Carli Lloyd was the United States' Olympic hero again as they avenged their World Cup final defeat by Japan and took gold at Wembley.
Lloyd's brilliant two goals in the final were enough for the USA to complete a hat-trick of Olympic titles, as the midfielder added to her winner in the 2008 final.
They also made amends for her penalty shoot-out miss in last year's World Cup final.
Yuki Ogimi pulled a goal back for Japan, who had plenty of chances to equalise and were denied by the woodwork as they failed in a bid to add the Olympic title to their world crown.
But they contributed to a superb spectacle and another brilliant advert for the women's game.
The USA were playing in their fifth successive final, having lost just one of the previous four, while Japan were in their very first.
Both sides had survived scares in the semis, the USA coming from behind three times to beat Canada in extra-time, and Japan weathering a second-half onslaught against France.
There was good support for each team among the 80,203 crowd - a record for a women's game at the Olympics - with alternate chants of "USA" and "Nippon", but it was the former fans celebrating in the eighth minute as Lloyd opened the scoring.
Tobin Heath got free down the left and crossed for Alex Morgan, whose heavy touch actually allowed her to stand up a ball which Lloyd arrived late to nod home, stealing it off the toe of Abby Wambach.
It was the first time Japan had been behind all tournament and they responded superbly, going close twice in quick succession 10 minutes later.
A fine move ended with Nahomi Kawasumi's shot being blocked by Christie Rampone - although it may have been going wide - with Hope Solo thwarting Ogimi on the rebound.
Solo then excelled herself, magnificently tipping Ogimi's header from Kawasumi's cross onto the crossbar, Ogimi smashing over the follow-up.
Heath was lucky to get away with handballing Aya Miyama's free-kick as Japan continued to dominate but they enjoyed a let-off themselves when Azusa Iwashimizu headed Amy LePeilbet's cross against her own post.
They should have equalised in the 33rd minute, Miyama the next to hit the woodwork after Shinobu Ohno found herself all alone in the box, the latter then sending a beautiful curling shot inches wide.
Both sides threatened early in the second half before Lloyd scored a stunning second goal in the 54th minute.
The Japan defence backed off as the midfielder carried the ball forward but even they could not have predicted the unstoppable 20-yard shot that flew into the net.
However the world champions refused to buckle and, after bringing on Asuna Tanaka, they halved the deficit in the 63rd minute.
A lovely move saw Homare Sawa's shot blocked by Rampone and the ball broke for Ogimi to poke home.
A sprawling Miho Fukumoto save prevented Rachel Buehler restoring the USA's two-goal lead while there was a desperate scramble at the other end after they failed to deal with a free-kick.
Lloyd was agonisingly close to a hat-trick when she drove inches over and Japan substitute Mana Iwabuchi should have equalised when she robbed Rampone 20 yards out but shot too close to Solo, who nevertheless produced a fine save.
Wambach could have netted late on but it did not matter that she missed out as the USA held on.