Senegal and Algeria are now due to face off to win the 2019 Africa Cup of Nations (AFCON) title in Friday's final in the Egyptian capital Cairo.
Senegal qualified for the AFCON final by beating Tunisia 1-0 in Sunday's semifinal.
The deadlock in Cairo was broken in extra time as Tunisian defender Dylan Bronn scored an own goal in the 101st minute.
This goal clinched the victory for Senegal as they advanced to the final stage in Egypt 2019.
Meanwhile Algeria got to the final by besting Nigeria 2-1 in the semifinal match.
Algeria took the lead in the first half as Nigeria's William Troost-Ekong put the ball into his own net.
But Nigeria scored the equalizer in the 72nd minute of this game as Nigerian forward Odion Ighalo successfully converted a penalty.
Algeria bagged the AFCON final ticket in injury time as Manchester City winger Riyad Mahrez scored a free kick, clinching the Algerian victory.
Semifinal losers Tunisia and Nigeria will meet in a third-place playoff on Wednesday.
Results of the semis
Senegal - Tunisia: 1-0
Algeria - Nigeria: 2-1
AFCON final
July 19:
Senegal - Algeria