BEIJING — They wanted a win. A tie would have been sufficient. The one thing the U.S. Olympic soccer team could not afford was a loss against Nigeria in the final group match on Wednesday.

But a crippling red card in the third minute was too much to overcome, and the U.S. is heading home after a 2-1 loss at Workers Stadium. The U.S. finished with a 1-1-1 record. Nigeria and the Netherlands advanced to the quarterfinals.

Misfortune hit the U.S. squad before the game even began when the two best midfielders, Freddy Adu and Michael Bradley, were ruled out after accumulating two yellow cards apiece. Then, three minutes into the match, defender Michael Orozco was ejected with a red card for elbowing a Nigerian player when they were entangled.

Playing 90 minutes of soccer in the oppressive humidity of the Chinese capital is bad enough, but doing it with 10 men against a team with Nigeria's speed and attacking style is a recipe for disappointment.

"I can't say if the card was justified or not because I didn't see the play, but it is extremely difficult to play a game when you lose a man by the fourth minute," U.S. coach Peter Nowak said. "It changed the game completely. The lineup is affected. The whole mentality is in the trash. Maybe the referee made a rash decision, but that's behind us and there's nothing we can do."

He said he didn't want to speculate and "make harsh comments" about the officials, but Nowak then said: "I didn't expect this kind of reaction from the ref four minutes into a game. It's unacceptable."

Forward Jozy Altidore, who grew up in Boca Raton and plays for Villarreal in Spain, said the red card "just killed the game," and he thought the referee should have issued a caution rather than ejecting Orozco.

Nigeria took advantage of the extra man and fired a barrage of shots at U.S. goalkeeper Brad Guzan. The Nigerians outshot the U.S. 17-1 in the first half, and had 11 shots on goal to zero for the U.S.

Captain Promise Isaac put Nigeria ahead 1-0 in the 39th minute. He and four teammates fell to the ground in unison to celebrate the goal as a spirited clot of a few hundred green-and-white-clad Nigerian fans many in green wigs bobbed up and down and played horns.

Nigeria made it 2-0 in the 79th minute on a goal from Victor Obinna. But the undermanned Americans were not about to cave. They continued to attack, and closed the gap to 2-1 in the 88th minute on a penalty kick by Sacha Kljestan. Nigerian goalkeeper Ambruse Vanzekin had taken down Maurice Edu in the box, leading to a yellow card and the PK.

Vanzekin dived to the right, Kljestan shot left, and all of a sudden, the U.S. had a prayer.

The crowd began chanting "U-S-A! U-S-A!" and things got really exciting. The U.S. got inches from tying in the 90th minute when Charlie Davies' header bounced off the crossbar. Davies had entered the game in the 77th minute, when Nowak realized Holland was beating Japan and the U.S. needed goals fast. Davies got off another good shot in extra time, but Vanzekin was able to get his glove on it.

"This match was harder than we thought," Nigerian forward Victor Anichebe said. "They even hit the bar near the end and they were good despite being reduced to 10 men very early."

Guzan said he goes home without a medal, but with great memories and respect for his teammates. "We created something really special in a short amount of time, and came really close to going to the quarterfinals. We tied the Netherlands 2-2, and should have won, and then we fought hard with a man down almost the whole game. We have a lot to be proud of."

Adu, who watched from the stands, said he hopes fans remember the team "not for the loss, but for its fighting spirit."

Nowak said the locker room was quiet after the match, and he had a hard time expressing his feelings to his players.

"I am disappointed, there is no question about that," Nowak said. "But these boys played so hard. For me, the last five to 10 minutes they won a gold medal. In my heart, we won a gold medal with our effort, and I will cherish the moment forever."