Libya beat Zimbabwe and Ghana beat Nigeria in penalty shootouts to clinch their places in the African Nations Championship final.
Ghana won 4-1 on spot-kicks, having overcome Kwabena Adusei's red card in the 64th minute to hold Nigeria to a 0-0 draw after extra-time.
And Libya beat Zimbabwe 5-4 shootout after they had also played out a goalless draw in their semi-final.
Libya and Ghana will contest the final on Saturday in Cape Town at 1800 GMT.
Ghana did well to resist the Super Eagles, who had a man advantage for more than an hour but could not make it count.
The closest Nigeria came was in added time at the end of extra-time when Imenger Barnabus had a close-range header superbly tipped over.
Barnabus also squandered two earlier chance in extra-time, missing from six yards and dragging another shot just wide.
Nigeria proved similarly profligate with their penalties, missing two of their first three, while Ghana scored each of their four kicks to secure victory.
Earlier in the day, Libya rode their luck in a goalless 120 minutes with Zimbabwe, who failed to take the better of the game's few chances.
In the first half the Warriors threatened through Ali Sadiki's 25-yard shot and a Simba Sithole header either side of Mohamed Ghanudi's headed effort for Libya.
After the break, neither side were able to find their rhythm and the lone opportunity came seven minutes from the end when Zimbabwe's Kudakwashe Mahachi smashed over from inside the box.
Extra-time was a cagey affair but Libya might have snatched victory when Elmutasem Abushnaf struck a shot between the legs of keeper George Chigova only for the ball to drift wide.
It took Javier Clemete's side three attempts to win on penalties - they missed their fifth and seventh spot-kicks after Zimbabwe had fallen behind with misses of their own - before goalkeeper Mohamed Abdaula scored his side's eighth kick to earn victory.