Senegal seized the second chance it was given by FIFA to qualify for the World Cup on Friday, beating South Africa 2-0 in a replay of a game it lost first time round last year.

FIFA ordered the qualifier to be played again because of match-fixing by the referee in the initial match in November 2016. At the centre of FIFA's decision was a penalty given against Senegal for a non-existent handball that helped South Africa win 2-1 12 months ago.

Senegal used the contentious replay at the same stadium in Polokwane in northern South Africa as the annulled game to seal its place at the World Cup for the first time since 2002.

Sadio Mane was pivotal in both goals. He set up Diafra Sakho for the opener in the 12th minute and forced an own goal by South Africa defender Thamsanqa Mkhize in the 39th.

"Thank you, South Africa," Mane said. "It was not an easy game for us but we kept pushing."

As Senegal's qualification was confirmed at the final whistle, the Senegalese players huddled together and bounced up and down in celebration. Coach Aliou Cisse knelt and held his arms up. Cisse was captain of the Senegal team that made the quarterfinals of the World Cup in 2002, then only the second African team to get to the last eight.

That was the last and only time Senegal has made it to the World Cup.

Senegal joins Nigeria and Egypt as qualifiers for the 2018 tournament from Africa, so far. The last two qualifiers from Africa will be decided on Saturday. Either Tunisia or Congo and Morocco or Ivory Coast will make up Africa's contingent in Russia.

Meanwhile, Nigeria couldn't hold on in Constantine as host Algeria scored an 88th-minute equalizer for 1-1.

Without FIFA's intervention, Senegal's group would have gone down to the last qualifiers next week, and all four teams would have still had a chance of qualifying. Burkina Faso and Cape Verde are the other two teams, both of whom were searching for a first-ever appearance at the World Cup.

Completing South Africa's misery, it created more chances than Senegal in the replay but couldn't make them count, hitting the crossbar in the first half and forcing a slew of saves from Senegal goalkeeper Khadim Ndiaye.

"All that talk doesn't mean anything because they beat us 2-0 and they go to Russia," South Africa coach Stuart Baxter said.

FIFA's unprecedented decision to order the replay and give Senegal another chance came in September after the world body found Ghanaian referee Joseph Lamptey guilty of match-fixing. Lamptey was banned for life after FIFA found he was probably manipulating the game for betting rings. There was no involvement from the South Africa or Senegal teams. But the decision to replay a game because of fixing caused serious discontent among the three other teams competing against Senegal for a World Cup place.

South Africa decried the decision to strip it of its victory as unfair while Burkina Faso appealed FIFA's decision to the Court of Arbitration for Sport, calling it "an abuse of power." CAS has not announced any decision regarding Burkina Faso's appeal and it's unclear what would happen if sport's highest court upholds the appeal.

In that case, Senegal's celebrations might be premature.

___

More AP World Cup coverage: www.apnews.com/tag/WorldCup