Riyad Mahrez scored a dazzling free-kick with essentially the last kick of the game as Algeria beat Nigeria to achieve the Africa Cup of Nations final.
With the match heading for additional time, Manchester City forward Mahrez whipped a furious set-piece into the top corner.
A William Troost-Ekong own goal had given Algeria the lead before Odion Ighalo’s punishment leveled the scores.
Algeria will confront Senegal, who prior beat Tunisia because of an extra-time possess goal.
Algeria started brightly and came close on two occasions thanks to the dangerous Baghdad Bounedjah.
The striker first poked the ball past Kenneth Omeruo then shot straight at Daniel Akpeyi, before bursting through on goal only for Jamilu Collins to narrowly lift the ball over his own crossbar.
But Algeria took a deserved lead when Troost-Ekong turned Mahrez’s deflected cross into his own net from close range.
Nigeria equalised through Ighalo after Aissa Mandi was penalised, following a VAR review, for handling Peter Etebo’s shot.
That was just the second goal Algeria have conceded in the tournament, but they responded well, and Mahrez’s late strike kept alive their hopes of a second Afcon title.