It was the flying winger’s second of the game, having put his country 1-0 up against Congo in the 63rd minute.
A late equaliser from Arnold Bouka Moutou threatened to delay the Egyptian celebrations until the final round of qualifying games next month.
However, when they were awarded a spot-kick right at the death, Liverpool’s summer signing kept his nerve to send Egypt to Russia.
The win means they are four points clear of second-placed Uganda with only one game remaining.
It is the first time Egypt have qualified for a World Cup since 1990 and finally gives 44-year-old veteran goalkeeper Essam El-Hadary the chance to represent his country on the biggest stage.