Substitute Kelechi Iheanacho scored to give Nigeria a 4-2 penalty shootout victory over South Africa on Wednesday after an Africa Cup of Nations semi-final thriller in Bouake.
The match finished 1-1 after extra time and the three-time champions will face hosts Ivory Coast or the Democratic Republic of Congo, who meet later, 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.
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, who plays in South Africa, parried a free kick.
South Africa finished with 10 men as Grant Kekana was sent off on 115 minutes for a last-defender foul.
"Our team has a huge state of mind. The team fights together, There are 25 of us (in the squad and) it's difficult to beat us," said Nigeria coach Jose Peseiro.
"I am very happy, the players are happy, they deserve it, we deserve it, the Super Eagles deserve it, the Nigerian people deserve it."
Nigeria entered the match with a perfect record against South Africa in the premier African football competition having won three previous meetings.
The Super Eagles beat Bafana Bafana (The Boys) 2-0 in a 2000 semi-final in Nigeria, 4-0 in a group match four years later in Tunisia and 2-1 in a 2019 quarter-final in Egypt.
Peseiro made one change to the team that beat Angola 1-0, bringing in Bright Osayi-Samuel for left-back Zaidu Sanusi.
- Osimhen scare -
Napoli star Osimhen started 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.
South Africa coach Hugo Broos also made one change after victory on penalties over Cape Verde with central defender Siyanda Xulu recalled and Thapelo Morena dropping to the bench.
South Africa had an equal number of shots at goal, but more on target, greater possession, and forced more corners in a tense, lively opening half.
Barely a minute after the kick-off, reigning African Player of the Year Osimhen knelt clutching his abdomen, but he continued after treatment and worked tirelessly.
When pre-match favourites Nigeria were awarded a free-kick, Semi Ajayi headed tamely at goalkeeper Ronwen Williams, who saved four shootout penalties against Cape Verde.
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.
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 before the shootout.