Great Britain will play Canada in the quarter-finals of the women's Olympic football tournament after defeating Brazil 1-0 at Wembley.
Steph Houghton struck from a tight angle in the second minute to score her third goal in as many games.
Kelly Smith had a penalty saved after the break as GB went in search of a decisive second.
But they held on to earn the win that sees them top Group E, much to the delight of a record 70,584 crowd.
It was not quite enough to break the Olympic record of 76,489 set at the 1996 Games, but it comfortably surpassed the 53,000 who watched Dick, Kerr's Ladies FC take on St Helen's Ladies at Goodison Park in 1920.
And the masses inside Wembley created a fantastic atmosphere as they witnessed a match that was a superb advert for the women's game.
There might not have been that many clear-cut chances but there were moments of great skill, lots of passion and a series of thundering tackles from Brazil that angered the home fans. It was a fantastic occasion, with GB now the only team not to have conceded in the tournament.
The match could not have got off to a better start for the hosts, with left-back Houghton striking so early in the contest.
The defending was pretty poor but there was nothing shoddy about the finish as Houghton collected a pass from Karen Carney and took a touch before slotting home with a low strike.
The goal produced a surge of noise inside Wembley but coach Hope Powell stood on the sidelines visibly trying to calm her players down.
Perhaps she knew what was to follow because Brazil, fourth in the world rankings, soon started to look dangerous, dominating possession and occasionally mesmerising their opponents with dazzling footwork.
Cristiane twice shot wide from long distance after GB had squandered possession, while the 27-year-old forward was later denied by Karen Bardsley after some scintillating approach work from Thais Guedes.
Brazil also went close when Alex Scott was forced to head against her own post after being put under pressure by Marta and Cristiane.
Beijing silver medallists Brazil did not have it all their own way and two very cynical challenges from Bruna and Rosana showed how concerned they were by GB's attacking threat.
It took some last-ditch defending to clear a cross from Carney, with skipper Casey Stoney lurking at the far post, while Smith was not far away with a cracking strike across goal.
Powell's team wasted a golden opportunity to extend their lead after the break, when Smith's penalty was saved by Andreia diving to her left.
The spot-kick, correctly awarded not long before the hour mark after Francielle brought down Eniola Aluko, came during a period when the home team looked threatening.
Kim Little, anonymous in the opening 45 minutes, came to life and played a series of dangerous passes as Brazil seemed to lose a little of their sparkle.
But they reminded everyone of the danger they posed when Marta, who boasts better than a goal-a-game ratio for her country, drew a save from Bardsley with a low strike from a tight angle.
GB closed out the victory - their third straight win in the group - to send the Union flags fluttering around Wembley at the final whistle.
In the other Group E fixture, New Zealand beat Cameroon 3-1 to sneak through as one of the two best third-placed finishers. They will now face reigning Olympic champions United States.
Rebecca Smith, an own goal by Ysis Sonkeng and a Sarah Gregorius strike helped New Zealand race into a three-goal lead, before Gabrielle Onguene pulled one back for the African side.