The final matchup for the 2019 Africa Cup of Nations was decided on Sunday, as Senegal defeated Tunisia and Algeria edged Nigeria in the semi-finals.
Senegal is seeking its first Cup of Nations title, 17 years after their only previous appearance in the final. Algeria hasn't been in the final since they won their only title in 1990. Senegal and Algeria will battle for the title on Friday in a repeat of a group stage clash Algeria won 1-0.
A bizarre own goal in extra time handed Senegal a 1-0 victory over Tunisia in the drama-filled first of Sunday's Africa Cup of Nations semi-finals.
A horrific mistake by goalkeeper Moez Hassen in the 100th minute saw the ball bounce off the head of defender Dylan Bronn and into the net for the only goal of a game in which both teams had second-half penalties saved.
Hassen came flying off his goal-line to try to cut off a freekick from the right flank but completely missed the ball which then hit the unfortunate Bronn on the head.
Both teams had a chance to settle the result in the second half at the 30 June Stadium but squandered spot kicks.
Tunisia felt aggrieved after referee Bamlak Tessema changed a decision to award them another penalty after consulting the Video Assistant Referee with seven minutes left of extra time.
Senegal captain Cheikhou Kouyate headed clear a freekick on to the arm of team mate Idrissa Gana Gueye in the Senegal box but, after consulting VAR, the referee decided Gana Gueye's arm was not moving and changed his mind.
The first half was dominated by Senegal, with Youssouf Sabaly hitting the post and Sadio Mane rounding Hassen but stumbling as he tried to convert from a difficult angle and missing the target.
After the break there were two good chances for Tunisia center forward Taha Yasine Khennissi as he broke free of the center backs and got on to the end of balls through the middle. The first he hit over and a heavy first touch on the second allowed Senegal goalkeeper Alfred Gomis to come off his line and smother the ball.
In the 73rd minute a stinging effort from Ferjani Sassi was blocked by Senegal center back Kalidou Koulibaly, turning his back as he slid into the path of the shot which struck him on his elbow.
The referee awarded a controversial penalty and also booked the Napoli center back, now suspended for the final.
But Sassi hesitated as he stepped up to take the kick and hit a tame effort right into Gomis's hands, throwing away a golden chance with 15 minutes left to play.
Three minutes later Ismaila Sarr was tripped in the Tunisia penalty area by Yassine Meriah.
After Mane had missed two earlier in the tournament, Henri Saivet took over penalty duties, hammering a strong shot to the corner only to be denied by a left-handed save from Hassen.
For Algeria, Riyad Mahrez rifled in a stoppage-time free-kick to earn the team a dramatic 2-1 victory over three-time champions Nigeria.
Algeria led through a first-half own goal by William Troost-Ekong before Nigeria equalized with an Odion Ighalo penalty awarded after a VAR review.
However, as extra time looked necessary, Mahrez blasted in from 20 yards with the last kick of the match to send the Desert Foxes through to their first final since lifting the trophy for the only time in 1990.
An injury to Youcef Atal, who fractured his collarbone during the quarter-final win over Ivory Coast on penalties, forced Djamel Belmadi to start Mehdi Zeffane at right-back, while Nigeria fielded the same team that overcame South Africa here.
Algeria supporters filled most of the lower tier at one end of the ground, dwarfing a small section of Nigeria fans, but there were large swathes of empty seats at the 75,000-capacity Cairo International Stadium.
Leading scorers in the tournament and considered the most impressive side, Algeria quickly asserted themselves as Ramy Bensebaini headed narrowly over before a wicked Youcef Belaili cross nearly lead to a goal for Baghdad Bounedjah.
Hesitant defending from Kenneth Omeruo just outside his own area then allowed Bounedjah to nip in, but the Al-Sadd striker could only shoot tamely at Daniel Akpeyi.
Seemingly having moved on from the penalty miss that reduced him to tears in the last round, Bounedjah was consistently proving a nuisance to a nervy Nigeria backline with Jamilu Collins relieved to see a toed clearance land on the roof of the net.
Nigeria countered intermittently as Ighalo dragged wide after Mahrez was caught in possession, but the Manchester City winger promptly atoned as Algeria made the breakthrough on 40 minutes.
After gathering the ball on the right Mahrez danced past Collins before sending over a cross that flicked off the left-back and struck a helpless Troost-Ekong in the midriff before tricking over the line.
Super Eagles boss Gernot Rohr has praised his side's resilience, particularly the way they bounced back from a shock loss to Madagascar to eliminate defending champions Cameroon, and Nigeria again hit back with the aid of VAR.
Gambian referee Bakary Gassama initially dismissed Nigerian penalty appeals when a Peter Etebo shot struck the arm of Aissa Mandi but reserved that decision, with Ighalo sending Rais Mbohli the wrong way from the spot for his competition-best fourth goal.
Sofiane Feghouli blazed over late on and extra time beckoned after Ismael Bennacer rattled the bar in stoppage time, but Mahrez won it at the death with a thunderous strike into the top corner.