Franck Fife AFP
South Africa goalkeeper Ronwen Williams saved four penalties in a shootout as his country beat Cape Verde 2-1 in a shootout after a 0-0 draw following extra time in Yamoussoukro.
Bryan Teixeira was the only Cape Verdean to score from the spot while Teboho Mokoena and Mothobi Mvala netted for South Africa.
South Africa are back in the semi-finals for the first time since 2000, when they lost to then co-hosts Nigeria, their opponents in Bouake on Wednesday.
Cape Verde could have won the match in added time at the end of regular time when Gilson Tavares broke through, but Williams pushed his shot on to the post and the ball was cleared.
On Friday, Nigeria edged Angola 1-0 through an Ademola Lookman goal and DR Congo came from behind to beat Guinea 3-1 with a late Arthur Masuaku goal from a free-kick sealing success.
Nigeria, who can call on reigning African Player of the Year Victor Osimhen, have won the AFCON three times, Ivory Coast and DR Congo twice each and South Africa once.
Meanwhile, Oumar Diakite was the hero as hosts Ivory Coast staged another remarkable salvage operation on Saturday to reach the Africa cup of Nations semi=finals, and South Africa later joined them.
A brilliant back-heel by the substitute in added time at the end of extra time in Bouake gave the Elephants a 2-1 victory over Mali, who dominated much of the quarter-final and scored first.
Ivory Coast-born Nene Dorgeles put Mali ahead on 71 minutes against the host nation, who were reduced to 10 men just before half-time when Odilon Kossounou was sent off.
But another Ivorian substitute, Simon Adingra, levelled in the 90th minute to take the pulsating west African showdown into extra time.
Then, with the quarter-final seemingly set to be decided by a penalty shootout, Diakite back-heeled a drive from a teammate past Mali goalkeeper Djigui Diarra.
Diakite, who had been yellow-carded earlier, took off his shirt when celebrating, leading to a second caution followed by a red card.
Victory came at a high price as suspensions rule Diakite, Kossounou, captain Serge Aurier and Christian Kouame out of a semi-final against the Democratic Republic of Congo on Wednesday.
"After this kind of match, there are no real things to explain, it is just emotions," said Diakite, who plays for French Ligue 1 outfit Reims.
"My joy was so great that I forgot that I had a yellow card. It was a mistake on my part. Even if I am not there, we can do the job (reach the final).
"With this goal, I think I put happiness on the faces of every Ivorian fan at the stadium. No words can describe how I'm feeling now, but I'm happy.
"We knew it was going to be a complicated match, but we made it difficult for ourselves. Our mentality played a key role in this triumph," he said.