LONDON – The United States gained sweet revenge on Thursday for one of the most painful women's soccer defeats, beating Japan 2-1 to take the Olympic Games gold medal before a record crowd of 80,203 at Wembley Stadium.

A pair of outstanding goals from midfielder Carli Lloyd was enough to ensure the Americans avenged their defeat by the same opponent on penalty kicks in last year's Women's World Cup final. The U.S. still had to weather a late comeback by Japan, which applied constant pressure after Yuki Ogimi's 63rd-minute goal.

Lloyd missed the Americans' first penalty in the shootout on that fateful night in Frankfurt, Germany, but the 30-year-old midfielder was the difference maker here, scoring with an opportunistic header after seven minutes, then smashing home the second just after halftime. Thursday's victory was redemption for the U.S., but Lloyd downplayed that factor for her personally.

"The penalty shot wasn't in my mind one bit – it happens," said Lloyd, who scored the extra-time winner against Brazil in the 2008 Olympic final in Beijing. "To be honest, it was just another game. We obviously lost to them at the World Cup, but this was just another game and another opportunity to show that we're the No. 1 team in the world."

It was a high-quality contest throughout, the kind you might expect from the two teams who are undoubtedly the finest in the women's game right now. In the end there was little to choose between them, but the nerve of the U.S., plus some small yet welcome morsels of fortune, got it over the line.

This was an Olympic title – America's third straight – that head coach Pia Sundhage's team started speaking about within minutes of letting a World Cup that was theirs for the taking slip through their grasp. It was seen as the only way to make up for that disappointment, and redemption was duly completed.

"In the last 20 minutes, we knew they were going to do whatever it took to get that equalizer," USA's Abby Wambach said. "I said, 'Guys, this is all about heart now. We're all tired. It's about who wants it more.'"

Japan may be left to rue the slow start that left it with an uphill battle. With neither side fully into its rhythm, the Japanese defense was caught surprisingly off-guard. Tobin Heath made a strong run down the left side and fed the ball to Alex Morgan, whose floated cross was directed right toward her forward partner, Wambach.

But just as the ball lost a little momentum as it approached the tall striker, Lloyd dashed in and launched a powerful header into the net for a 1-0 lead.

"I made sure that I was getting in the box, and I saw Alex," Lloyd said. "Anytime she's in that final third, I know she's going to beat her player. She swerves in great balls, and I saw that one coming, so I took off on a sprint."

The goal was a wake-up call for Japan, and soon goalkeeper Hope Solo found herself under pressure.

At 16 minutes, Nahomi Kawasumi sent over a swirling cross from the left, and Ogimi's header was pushed onto the crossbar by Solo. The rebound fell to Ogimi, who could only smash it well off target.

Japan was cursing the woodwork again midway through the period, as captain Aya Miyama's drive could not be reached by Solo and hit the bar.

If the Americans were a little fortunate to still be ahead going into the break, Lloyd's second goal was a timely boost to their confidence. Lloyd finished off a sparkling run with a fierce strike past the outstretched arms of goalkeeper Miho Fukumoto.

"I was just doing what I do best – taking the space and running at players," Lloyd said. "I continued to dribble and took the open shot."

Japan did not become world champion by giving up, and the players displayed impressive resilience. With 63 minutes gone, the U.S. could not recover from a mad scramble in its own penalty area and saw its cushion halved. Homare Sawa, the player of the tournament at the World Cup, was starting to stamp her authority on the game, but it was Ogimi who got the goal for Japan to send nerves jangling for Sundhage's side.

And when substitute Mana Iwabuchi went clear on goal with eight minutes to go, it looked like another nail-biting period of extra time could be in the cards. Solo remained strong, though, pushing away a solid effort to retain the lead.

"Hope made some huge saves," Lloyd said. "That's what she does – she comes up big."

The biggest crowd to watch an Olympic women's soccer match packed into Wembley, one of the sport's most iconic venues, on what was a tremendous night for the women's game regardless of the scoreline.

That would have been of little consolation to the Americans had they lost, but this is a team that has a habit of rising to a challenge of Olympic proportions. The final whistle sparked scenes of delirious celebration as those demons from 13 months ago were well and truly exorcised.