Ronaldo became the first man to play in five European Championship tournaments, and his two goals in the victory took him to 11 -- which became an outright record.
Borussia Dortmund's Raphael Guerreiro broke the deadlock after 84 minutes with a shot from the centre of the box, while Ronaldo scored from a penalty three minutes later.
The Portugal forward then superbly added a second in injury time, dancing through a string of challenges to slot home his second of the match.
Ronaldo, who overtook Michel Platini as the Euros' leading scorer of all-time, was relieved to see the offside flag raised as he missed early on. The Juventus striker grew increasingly frustrated towards the end of the first half when his effort from close range sailed over the bar when he really should have scored.
Boosted by vociferous support of 60,000 fans at their home stadium, Hungary threatened sporadically, with Adam Szalai causing Portugal the most problems.
Portugal's frustration grew in the second half, as Manchester United's Bruno Fernandes went close with an effort from outside the box, but Hungary goalkeeper Peter Gulacsi did well to tip it round the post. But just as it looked as if Ronaldo would have to settle for one record and a disappointing draw, Portugal turned on the style late on with Guerreiro's deflected finish, before Ronaldo took centre stage.
After dispatching a clinical penalty sending Gulacsi the wrong way, Ronaldo added a superb second with a fine finish.