Landon Donovan scored in injury time as the United States advanced to the round of 16 at the World Cup with a 1-0 win over Algeria in Pretoria on Wednesday.
The United States topped its group at the World Cup for the first time since 1930, leading Group C with five points.
England also progressed with five points, but with an inferior goal difference, 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 US record.
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 the final whistle sounded, the US bench raced onto the field and piled on top of the players on the far sideline.
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 sixth minute, with the striker's shot hitting the crossbar after US defender Jay DeMerit failed to clear a long ball.
Algeria, which has never advanced beyond the group phase in a World Cup, finished with one point from its dour draw with England.
The Americans 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. AP