The seven-time Afcon champions took an early lead through Mostafa Mohamed, only for Mozambique to turn the game on its head with two goals in four second-half minutes through Witi and Clesio.
But Mozambique’s hopes of an historic win were crushed seven minutes into added time when Salah converted from the spot after a VAR check ruled there had been a foul on Mohamed.
Egypt were straight out of the blocks and went ahead just two minutes in. A cross found Salah and the Liverpool forward’s mis-hit his shot allowed Mohamed to pounce on the ball, neatly turning around Edmilson Dove and firing low into the bottom corner.
They nearly doubled their lead when Salah broke from a Mozambique attack and threaded the ball to Mohamed, but his effort was straight at the goalkeeper.
Witi went close when he sliced his shot wide before Egypt had another great chance to extend advantage lead as Mahmoud Trezeguet smashed the ball off the post.
Mohamed El Shenawy had to react following a poor attempted clearance from Mohamed Hamdy, the Pharaohs goalkeeper clawing the ball over the bar to maintain his side’s lead.
Mozambique continued to push in the second half, though, and got their reward in the 55th minute when Domingos Macandza’s cross picked out Witi, who headed into the bottom corner, with El Shenawy getting a hand to the ball but unable to keep it out.
The Mambas then took the lead three minutes later when, after a good team move, Clesio evaded Ahmed Hegazi’s tackle and burst through the middle before coolly slotting past El Shenawy.
Zizo blasted wide for Egypt from outside the box and they continued to push for the equaliser, Hamdy Fathy flicking the ball past the post before an unmarked Salah sliced wide.
And Mozambique’s hopes of a famous triumph were finally dashed deep into stopage time, when Egypt were awarded a late penalty following a VAR check for a foul on Mohamed and Salah fired home from the spot.