Robert Koren scored a late goal Sunday to give Slovenia a 1-0 win over 10-man Algeria and first place in Group C of the World Cup, ahead of the United States and England.
The Slovenian captain struck a long-range shot that Algeria goalkeeper Fawzi Chaouchi misjudged and allowed to bounce into the net off his arm in the 79th minute.
It was the first-ever World Cup victory for Slovenia, the smallest nation in the tournament with a population of around two million. The Balkan country lost all three of its group matches in the 2002 tournament.
Algeria substitute Abdelkader Ghezzal was sent off in the 72nd, picking up a second yellow card for handling the ball inside the Slovenian penalty area.
Algeria twice came close in the first half when Nadir Belhadj's 25-yard free kick forced Slovenia goalkeeper Samir Handanovic to stretch and push the ball over the crossbar, and defender Rafik Halliche headed just wide.
Both sides knew they were heading into a match in which a loss would be costly, with tough games against England and the United States left on the schedule. The Group C favorites tied 1-1 Saturday after a blunder by England goalkeeper Robert Green allowed a Clint Dempsey shot to trickle into the net.
Algeria coach Rabah Saadane said Chaouchi apologized to the team for failing to track Koren's shot. But the coach refused to criticize the goalkeeper, and said it's difficult to predict the trajectory of the new World Cup ball.
"Everyone saw what happened with the ball, and what happened yesterday with England's goalkeeper. You have to adjust to the flight of the ball," he said.
"We must recover and prepare for an even more difficult match against England, which is the best of the group," Saadane said. "It's going to be very difficult now. We had a great opportunity today and we missed it."
The players seemed nervous in the first half, frequently losing possession with inaccurate passes and crosses.
Slovenia's only scoring chance before the break was Valter Birsa's long-range attempt in the 43rd minute, tipped over the bar with a spectacular right-hand save by Chaouchi.
The match could have taken a different turn when Algeria's Karim Ziani caught defender Marko Suler off guard and pushed toward the Slovenian goal but was cut off by Handanovic.
There was some commotion in the stands during the break when former French great Zinedine Zidane, who is of Algerian descent, was forced to climb to a higher section to get away from autograph-seeking fans who were pushed back briskly by security guards.
Algeria beat North African rival Egypt in a tense playoff to qualify for the World Cup for the first time since 1986. Slovenia reached its second World Cup with an upset playoff victory over Russia.
Slovenia faces the U.S. next while Algeria travels to Cape Town to take on England.