Updated

PRETORIA, South Africa -- Landon Donovan scored in injury time as the United States advanced to the round of 16 with a 1-0 win over Algeria in a stunning climax to Group C play Wednesday at the World Cup.

After coming within minutes of elimination, Donovan's late winner lifted the United States to first place in Group C with five points, topping a World Cup group for the first time since 1930.

England also progressed with five points but in second place, on the basis of goals scored, after its 1-0 win over Slovenia at Port Elizabeth.

Donovan slotted in the rebound after Algeria goalkeeper Rais Bolhi had stopped Clint Dempsey's shot from close range in the first minute of injury time. It was his fourth World Cup goal, equaling Bert Patenaude's U.S. record.

"Hands down the biggest moment in my career," Donovan said of the goal.

"I'm shocked. I'm so proud of our guys. Unbelievable," he said. "Clint made a good run in the middle, the ball fell to me ... time kind of stopped. You can't miss from there."

Both teams had chances but failed to score during regulation time in the free-flowing match at Loftus Versfeld Stadium in Pretoria. A 0-0 result would have eliminated both teams, as England had just completed its win over Slovenia, which had four points going into the last match.

So it set up a tense finish for the Americans, who held England to a 1-1 draw and staged a dramatic comeback from two goals down to level at 2-2 with Slovenia in its previous matches.

As the final whistle sounded against Algeria, the U.S. substitutes and staff raced onto the field and piled on top of the players on the far sideline. Now the Americans will play the second-place team from Group D -- which contains three-time champion Germany, Ghana, Serbia and Australia -- at Rustenburg on Saturday.

Donovan said he'd never despaired, even when the Americans hadn't been able to convert chances.

"We believe man. We're alive baby!" said Donovan, in tears at times after the match.

The United States had lost the last group stage match in the five previous World Cup tournaments.

Coach Bob Bradley said his U.S. team had to take risks, pushing hard for a goal to secure the win and making for a wide open game.

"We're proud," he said. "We finished first in our group. Five points. Didn't lose a match. So we're ready."

Dempsey had a goal disallowed for offside in the first half and hit the post in the second.

TV replays appeared to show Dempsey to be onside when he tapped into the net from close range after being fed by Herculez Gomez in the 21st minute. He hit the post in the 57th and missed the rebound.

Rafik Djebbour went close to scoring Algeria's first tournament goal in the 6th, with the striker's shot hitting the crossbar after U.S. defender Jay DeMerit failed to clear a long ball.

Former U.S. President Bill Clinton sat next to FIFA President Joseph Blatter amid the crowd of 35,000, watching the action switch quickly from one end to another.

Algeria tested U.S. goalkeeper Tim Howard with dangerous long-range strikes from Karim Ziani and Karim Matmour and the United States sought to break into the area with quick passing.

The break finally came for the U.S. when Donovan sent a pass to Jozy Altidore on the right flank. Altidore advanced and sent a low cross toward Dempsey, who was blocked by Bolhi. Donovan picked up the rebound and scored from 8 meters (yards).

Algeria, which has never advanced beyond the group phase in a World Cup, finished with one point from its dour draw with England and two losses.

Compounding the damage, Algeria captain Anther Yahia was sent off after getting a second yellow card just before the final whistle.

Coach Rabah Saadane said his team could have won with a little luck, but added his strikers lacked confidence in decisive moments.

"I think they missed a number of opportunities because the pressure on them," he said.

Algeria was the fourth African team to exit the first World Cup on African soil, with Cameroon, Nigeria and host South Africa already out. Ghana and Ivory Coast were still in contention.

"I think that Africa is on the right road," Saadane said. "What we need in our national teams and squads is stability and a lot of discipline and I think in a few years time, Africa will have among the best teams in the world."

After scoring two goals in the 2002 World Cup as a 20-year-old, Donovan virtually disappeared in the 2006 tournament, when the United States was eliminated in the first round. Then his marriage with actress Bianca Kajlich collapsed. But his career took an upswing this year during a three-month loan from the Los Angeles Galaxy to Everton.

"I've gone through a lot in the last four years," Donovan said, choking on tears, in the post-match news conference. "I'm so glad it culminated in this way. And it makes me believe in good in the world.

"When you try to do things the right way it's good to see them get rewarded."