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 to secure a result which moves the North Africans up to second in the Group D table, three points behind Nigeria but two points ahead of Guinea-Bissau and Sudan.
Salah had been isolated up front against the Super Eagles but was involved from the start against Guinea-Bissau, seeing his low effort from range clip the outside of the right-hand upright in the second minute.
The Egypt skipper then played his part in a sweeping move which ended with Mostafa Mohamed side-footing onto the base of the same post, and Salah had a volley deflected and pushed behind as the Pharaohs pressed before half-time.
Carlos Quieroz’s side were less impressive in the second half, but Amr El Soleya came up with a moment of quality to chip the ball into the box for Salah to convert with fine technique.
Guinea-Bissau failed to threaten for much of the game but Jorginho sent a shot straight at El Shenawy before Egypt enjoyed a stroke of fortune when Balde’s effort was chalked off.
Egypt face Sudan in their final group game on Wednesday (19:00 GMT) knowing a draw will be enough to secure second place in the group, while Guinea-Bissau must beat Nigeria to have a chance of advancing to the last 16.