PRETORIA - It was everything you hope a World Cup game would produce.
It had heart-stopping drama, enticing storylines and a storybook ending you wouldn't believe unless you had seen it.
The United States was three minutes from unfairly having its ticket punched for home.
Then just at death's door, Landon Donovan struck a stunning 91st-minute winner giving them a 1-0 win over Algeria.
The win not only allowed the Americans to move into the second round, but also gave them first place in Group C. The win relegated England to second place.
Who would have though Algeria and United States would produce such a stunning fixture? The fans were riveted by the action. It was classic football but it had unwavering energy and huge rewards for whatever team was willing to risk collecting them.
In the end, it was a fitting result. The Americans came to win and played that way.
It was also fitting that the United States survived despite having suffered outrageous officiating in two of its three games.
This time was the Belgium crew with Frank De Bleeckere in the middle.
"We will overcome," shouted one American flag-draped fan during the half.
The Americans had to overcome a great deal. They faced the tough Algerians knowing a win would guarantee a spot in the second round. But once England scored to go up on Slovenia, they had no other option. Anything other than a win would send them home.
And it looked as if they were off to a good start. Forward Clint Dempsey jabbed a ball into the net, but he was judged to be offside when he scored in the 20th minute. Replays show he was clearly onside. It was the second time in two games the Americans had a good goal waved off.
Maurice Edu scored a late goal against Slovenia but it wasn't counted because of a phantom foul.
"Of course, we should have and could have scored earlier, which would have spared us that dramatic ending," Donovan said. "In the end, though, it's a good thing that it happened that way, so quickly. I didn't even have time to think what I was going to do. The best thing for us to do now is to rest because we really need it, but I can assure you that we'll be ready for the next round."
Most teams would have been crushed by what happened.
But the Americans came out in the second half with an attacking formation and that's what they did. They attacked Algerian keeper Rais M Bolhi relentlessly.
"We're sorry for the people of Algeria, but they need to know that we gave everything," said Karim Ziani, Algeria midfielder.
Dempsey and Joze Altidore both had glorious chances and couldn't connect. As time wore down so it appeared did the Americans.
The Algerians had held England to a 0-0 draw and weren't easy to break down. As the game hit the 90-minute mark, four minutes of extra time was added. Still it appeared all was lost for the Americans.
It was high drama stuff as the desperate United States refused to acknowledge their time had come. But while most of the focus was on the Americans, Algeria with one point in the group knew a win might get them something.
They tried a final rush for the pot of gold and it did them in. American keeper Tim Howard made a save on a header and immediately lauched Donovan down the right side, trapping most of the Algerians. Donovan finished the long run by sending a low cross to Dempsey who bundled it off Bolhi.
The ball lay loose and Donovan snatched the winner.
Scenes of unbridled joy followed the goal both on and off the pitch. The stadium erupted in chants of "USA, USA." At the final whistle, the Americans celebrated on the pitch for more than 10 minutes, still trying to absorb what had happened.
Algerian fans and players lay stunned by the turn of events.