A last-gasp winner from Abdallah El Said helped Egypt to a hard-fought 1-0 win over Uganda as they took a major step towards the quarter-finals of the 2017 Africa Cup of Nations.
The Pharaohs struggled to create any chances of note, but substitute El Said found the net in the 89th minute to make the difference, thus ending Uganda's hopes of progressing.
Hector Cuper's Egypt are regarded as one of the dark-horses for the title, but they had to settle for a scoreless draw with Mali in their Group D opener.
They again failed to impress versus Uganda, finding it difficult to make much of an impact going forward.
Joseph Ochaya did find the net for Uganda, only to have his goal rightly ruled out for offside, and El Said eventually crowned himself Egypt's hero in Port-Gentil with his late goal.
The Pharaohs sit second in their pool with four points from two games following this weekend's encounter and face already qualified Ghana in their last group game, while Uganda take on Mali on matchday three.
Egypt started the match the better side of the two and they threatened on a number of occasions in the opening stages, Mohamed Salah in particular causing the Uganda defence a fair bit of trouble.
The Roma man had an attempt blocked in the 20th minute, before firing a right-footed shot from a narrow angle wide just minutes later.
Uganda almost went a goal up against the run of play after miscommunication between Ahmed Hegazy and goalkeeper Essam El Hadary at the half-hour mark, the defender eventually breathing a sigh of relief when his attempted clearance trickled just wide of the goal after beating his captain.
Milutin Sredojevic's men again threatened shortly after when Faruku Miya played a clever one-two with Tonny Mawejje before trying his luck from the edge of the area, but the Standard Liege winger aimed his shot wide of the target.
Ochaya then looked to have opened the scoring at last when he tapped home a throughball from Miya early in the second half, only for the referee to blow his whistle for offside.
El Said should perhaps have handed Egypt the lead on the hour mark when presented with a shooting opportunity from just inside the box after some sublime individual play from Ramadan Sobhi down the left, only for the substitute to steer his effort high and wide.
Trezeguet was the next Egyptian to try his luck with a low shot from the centre of the box, but his attempt lacked the power to really worry shot-stopper Denis Onyango.
Egypt refused to give up, though, and they finally broke the deadlock when El Said fired through the legs of Onyango after being set up by Salah to seal the win.