Watch VideoPlay Video
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.
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.
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.
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.
The United States had lost the last group stage match in the five previous World Cup tournaments. 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.
|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.