"I tried to rectify it in the second half, but things did not go well".
The Egyptian defense broke all of Portugal's attempts to score the equalizer in the remaining minutes and they were ready to celebrate the victory when Ronaldo made a decision to shine.
He then scored another with the final touch of the game, rising to thump home a towering header past the Egyptian goalkeeper.
There was more late drama when Ronaldo's second goal was initially chalked off for offside.
The European champions had enjoyed the better of a match played in a lively atmosphere but their African opponents showed enough to worry World Cup group rivals Russia, Uruguay and Saudi Arabia.
Around the half-hour mark, Cristiano Ronaldo's shot was denied by Abdallah El-Said who helped Mohamed El-Shennawy keep a clean sheet in the first half.
Ronaldo took his goal tally to 23 for both club and country in 2018 alone.
Quaresma, meanwhile, saw a 72nd minute attempt saved by Mohamed El-Shenawy in the Egypt goal while Bruno Alves saw a close-range header from a corner drift wide of the goal. However, Portugal's record scorer and most capped worldwide was not to be denied as he struck twice in three dramatic minutes. With the two sensational goals, Ronaldo moved up to the third spot in the all-time worldwide scorers' list with 81 goals.
Egypt coach Hector Cuper was disappointed with the result but happy with the performance.