Mohamed Salah scored a last-minute winner as Egypt came from behind to end Tunisia’s 100 percent record in African Nations Cup qualifying with a 3-2 win in Alexandria on Friday.
Morocco beat Cameroon 2-0 in Casablanca and are now one point from a place in next year’s finals.
Tiny Burundi moved a step closer to qualification for the first time with a 5-2 away win over South Sudan.
Egypt and Tunisia had already secured their places at the finals by making sure of the top two spots in Group J.
But their clash was still bristling with tension after last week’s victory for Tunisian club Esperance over Cairo’s Al Ahly in the African Champions League final.
Naim Sliti scored the opener for Tunisia after 13 minutes but Egypt were level at the break after Mahmoud “Trezeguet” Hassan equalised with a deflected shot.
Baher El Mohamady put Egypt ahead with a 59th-minute header but fellow defender Ahmed Hegazy handed Sliti the chance to score his second with a poor clearance 18 minutes from time.
Salah, who had a quiet match, then produced yet another last-gasp winner for his country in the 90th minute with a deft chip over the goalkeeper after a quick interchange of passes.
Tunisia remained top of the group on the head-to-head countback with both countries on 12 points from five matches.
Egypt have now won four matches since the 2018 FIFA World Cup in Russia under new coach Javier Aguirre.
A hat-trick from Abdul Razak Fiston inspired Burundi to a comfortable win over South Sudan in Juba and top place in Group C with nine points from five games.
Mali, on eight points, and Gabon, with seven, meet in Libreville on Saturday in the penultimate round of matches.
Burundi have been reinforced in recent matches by Saido Berahino’s decision to switch international allegiance from England.
But they would need a result at home to Gabon in their last qualifier in March to finish in the top two places and book a place in June’s finals in Cameroon.
Berahino and Cedric Hamissi scored Burundi’s other goals while Atak Lual and Dominic Aboy Koni got South Sudan’s first goals of the campaign, although they remained without any points.
Morocco’s Hakim Ziyech netted a 54th-minute penalty kick and struck with a shot from outside the box 12 minutes later to settle the heavyweight clash against Cameroon in Casablanca.
Cameroon are playing the preliminaries in spite of qualifying for the tournament as hosts.
2019 Africa Nations Cup qualifying continues across Africa on Saturday and Sunday with more countries set to join Cameroon, Egypt, Madagascar, Senegal and Tunisia in the 24-team finals line-up.