Mohamed Salah scored the only goal against Guinea-Bissau to kick-start Egypt’s Africa Cup of Nations campaign.
But the Pharaohs rode their luck as Mama Balde had a stunning late equaliser for the Djurtus ruled out after a video assistant referee review.
Record seven-time winners Egypt, who lost their Group D opener 1-0 against Nigeria, struck the woodwork three times in a game they largely dominated.
Salah volleyed in with 21 minutes left to secure a crucial victory in Garoua.
The Liverpool forward hit a first-time left-footed effort from the edge of the six-yard box which flew past the outstretched hand of Guinea-Bissau keeper Jonas Mendes.
In the 82nd minute, Balde cut in from the left and curled a shot just inside the right-hand upright, but the forward was adjudged to have fouled Egypt defender Omar Kamal in the build-up.
Egypt keeper Mohamed El Shenawy had to punch away a half-volley from Moreto Cassama in injury time.
The results moved the North Africans up to second in the Group D table, three points behind Nigeria but two points ahead of Guinea-Bissau and Sudan.
Egypt face Sudan in their final group game on Wednesday knowing a draw will be enough to secure second place in the group.
Meanwhile, Guinea-Bissau must beat Nigeria to have a chance of advancing to the last 16.