PRETORIA, South Africa -- Over and over, everything seemed to go against them.
A referee took away a win last week, and a linesman disallowed another goal Wednesday.
Now there was just 3½ minutes left in their World Cup, just that much remaining until all the doubts about American soccer would rise again.
But then, in one of the most stunning turnarounds in World Cup history, Landon Donovan scored on a lightning fast counterattack 45 seconds into 4 minutes of injury time. With the most amazing late-game moment in American soccer, the United States beat Algeria 1-0 and reached the World Cup's second round.
"This team embodies what the American spirit is about," Donovan said. "We had a goal disallowed the other night. We had another good goal disallowed tonight. But we just keep going. And I think that's what people admire so much about Americans. And I'm damn proud."
Former President Bill Clinton lingered in the locker room for 45 minutes after the game to congratulate the players. When Donovan scored, raucous cheers erupted on the floor of the New York Stock Exchange and even in White House auditoriums in Washington, D.C., according to e-mails sent to U.S. Soccer Federation president Sunil Gulati.
"That's probably going to capture more people's attention than if we won the game 3-0 and it was easy," American goalkeeper Tim Howard said. "That emotion, that passion is what American sports fans thrive on."
The United States won its first World Cup match in eight years and finished atop its first-round group for the first time since the original World Cup in 1930. With a quick turnaround, the Americans play Ghana on Saturday night (2:30 p.m. ET, ABC) in Rustenburg for a spot in the quarterfinals. Ghana won the final match of the opening round against the Americans to knock them out of the tournament in Germany four years ago.
Clint Dempsey appeared to score in the 21st minute off the rebound of Herculez Gomez's shot. But the goal was called offside.
Dempsey's 12-yard shot off Jozy Altidore's cross clanked off the far post in the 57th minute, and when the rebound came back to Dempsey, he put the follow shot wide to the near side.
"You shake it out of your head and keep on fighting," Dempsey said.
Knowing England was ahead of Slovenia at the half, the U.S. put in offensive substitutes, first Benny Feilhaber at the start of the second half, then Edson Buddle in the 64th and finally DaMarcus Beasley in the 81st.
"The second half wasn't a soccer game -- it was more like ... a track meet. Back and forth, back and forth, both teams are so desperate," Howard said.
Howard started the counter-attack that led to the goal when he knocked down an Algerian shot and rolled the ball to Donovan on the right flank. Donovan moved upfield and passed ahead to Jozy Altidore just inside the 18-yard box.
"Landon kind of knows me a little bit," Howard said. "He breaks out when I get the ball and it's kind of easy to find him."
Altidore's right-footed cross was flicked by Dempsey as he crashed into goalkeeper Rais Bolhi.
"I couldn't chip it over the keeper, so I just tried to hit it under him -- hit it hard," Dempsey said.
As Dempsey tumbled over the goalkeeper, the ball rolled back out. In ran Donovan, who with a right-footed shot from 7 yards, slammed the ball into the lower left corner of the net 45 seconds into 4 minutes of injury time.
"The moment kind of slowed down for me. It was as much a reaction as anything," Donovan said. "I kind of hesitated. I didn't know if he was going to play it across the goal or try to cut it back to me. Once he played it in front of the goal, I didn't sprint, but I kept my run going and once it popped off the goalie, then I picked up a little to get there."
After his U.S. record 44th international goal, Donovan joyously ran to the corner flag, sliding headfirst in a belly flop, and his teammates ran down the touchline to mob him.
"A lot of kisses. A little uncomfortable," Donovan said. "It's something I'll have imbedded in my mind forever."
When the game ended, Donovan kicked the final ball into the stands.
"Someone got a nice souvenir," he said.
He was in tears and even 30 minutes later his eyes watered and voice cracked as he talked about the goal. The field long empty, American fans remained in the stands, still cheering, waving the Stars and Stripes and blowing vuvuzelas.
As a 20-year-old in 2002, Donovan scored two goals and became a star. But expectations became crushing in 2006, when he went scoreless and the U.S. was eliminated in the first round. With his fourth World Cup goal, Donovan tied Bert Patenaude (1930) as the American leader.
"I've been through a lot in the last four years," Donovan said with tears in his eyes. "I'm so glad it culminated this way. When you try to do things the right way, it's good to get rewarded."
The United States finished a World Cup game with a shutout for just the fifth time in 28 matches (7-16-5) and topped Group C with 5 points.
England (1-0-2), which beat Slovenia 1-0 moments earlier, also had five points but finished second because the U.S. scored four goals to two for the English. Slovenia (1-1-1) was third with four points, missing advancing because of Donovan's heroics. Algeria (0-2-1) was last with one point.
The Desert Foxes were making their third World Cup appearance following first-round elimination in 1982 and 1986. Algeria was the fourth African team to exit the first World Cup on African soil, following Cameroon, Nigeria and host South Africa.
"I think that Africa is on the right road," coach Rabah 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."
Dempsey needed four stitches to close a cut on his lip.
It was yet another late goal for the United States, which came from behind to tie England 1-1 in its opener, then rallied from a two-goal halftime deficit against Slovenia and would have won had Maurice Edu's 85th-minute goal been allowed. In six of the final 10 qualifiers, the Americans gave up the first goals -- but they bounced back to win three of those games and tie two others.
"That was a really special feeling," U.S. coach Bob Bradley said. "These guys put a lot into it, they never quit.
"We're proud. We finished first in our group. Five points, didn't lose a match. So we're ready."
Howard bounced up and down in elation after the game. Feilhaber took a water bottle and sprayed his teammates, and it felt as good as champagne.
"We're not done yet," Donovan said. "We believe, man. We're alive, baby."