Substitute Kelechi Iheanacho scored to give Nigeria a 4-2 penalty shootout victory over South Africa on Wednesday after an Africa Cup of Nations semifinal thriller in Bouake.
The match finished 1-1 after extra time and the three-time champions will face hosts Côte d'Ivoire or the Democratic Republic of Congo in the final on Sunday.
Both regular-time goals also came from penalties with captain William Troost-Ekong scoring after 67 minutes for Nigeria and Teboho Mokoena equalised from a 90th-minute spot-kick.
The Mokoena equaliser came after Nigeria thought they had scored a second goal through a tap-in from star forward Victor Osimhen.
Perfect record
But play was called back to the other end of the field after VAR alerted the Egyptian referee that South African Percy Tau had been fouled in the area, and the match official concurred.
Khuliso Mudau had a chance to win for South Africa in added time at the end of regular time, but blazed over after goalkeeper Stanley Nwabali parried a Mokoena free kick.
South Africa finished with 10 men when Grant Kekana was sent off on 115 minutes for a last-defender foul.
Nigeria entered the match with a perfect record against South Africa in the premier African football competition having won in three previous meetings.
The Super Eagles beat Bafana Bafana (The Boys) 2-0 in a 2000 semifinal in Nigeria, 4-0 in a group match four years later in Tunisia and 2-1 in a 2019 quarterfinal in Egypt.
Weak shot
Nigeria coach Jose Peseiro made one change to the team that beat Angola 1-0, bringing in Bright Osayi-Samuel for left-back Zaidu Sanusi, who did not train on the eve of the match.
Star Napoli forward Osimhen started for the three-time champions after recovering from an abdominal discomfort that delayed his arrival in Bouake from Abidjan.
Some Nigerians in the stadium demonstrated their support for Osimhen by wearing replicas of the protective facial mask he still dons three years after suffering an eye socket injury.
Percy Tau had a couple of half-chances for South Africa, but a weak shot and later a heavy first touch let him down before a 32,000 crowd.
Disallowed goal
Nigeria goalkeeper Stanley Nwabali, who plays for South African top-flight club Chippa United, produced a good one-hand parry to foil Evidence Makgopa as half-time approached.
With the Super Eagles in the ascendancy, the deadlock ended midway through the second half when Mothobi Mvala fouled Osimhen and Troost-Ekong converted the penalty.
Makgopa fired narrowly wide with 15 minutes remaining as South Africa chased an equaliser in the central Ivorian city.
Then came the disallowed Osimhen goal, the Mokoena equaliser, the Mudau miss and 30 minutes of end-to-end extra time action, including a red card for Kekana, before the shootout.
➤Click here to follow our WhatsApp channel for more stories.