Riyad Mahrez scored a sensational free-kick in the 95th minute as Algeria beat Nigeria 2-1 to seal their place in the Africa Cup of Nations final.
Algeria led thanks to William Troost-Ekong's own goal but Nigeria hit back through Odion Ighalo's penalty, awarded following a VAR check.
Extra time was looming until Algeria, who have not been to the final since winning the tournament on home soil in 1990, won a free-kick on the edge of the box.
And Mahrez, star man for the Desert Foxes, bent the ball around the wall to beat Nigeria goalkeeper Daniel Akpeyi and seal his country a place against Senegal in Friday's final.