Ronaldo's header in the fourth minute was his fourth goal at this year's tournament, and his 85th for his country.
Morocco went on to lose the game 1-0, becoming the first team to be eliminated from the worldwide tournament.
But the 1976 African champions gave a good account of themselves, shading possession over A Selecao das Quinas and completing more passes.
"Come on, man, we're here at a World Cup, it's not a circus!"
With both sides failing to win their opening Group B match, there was a tense atmosphere inside Luzhniki Stadium prior to kick-off.
When they did manage to stop appealing and concentrate on playing, Morocco looked unsafe and were the dominant side in the second half.
Prince William And Kate Middleton Announce Prince Louis’ Christening Details
His brother Prince George was christened at a similar time, and was baptised about 13 weeks after he was born on October 23, 2013. With Prince Louis' christening soon to be out of the way, Kate could well fully return to the public eye.
Despite their battling display, Morocco will rue the unforgivable defending that made all their subsequent good work irrelevant.
It was his 85th global goal, taking him beyond Hungarian Ferenc Puskas's European record, with only Iran's Ali Daei ahead of him on 109.
They qualified for the finals without conceding a goal in six matches yet somehow opted against marking the most unsafe attacker at the tournament in the six yard box when Joao Moutinho swung in a cross from a short corner and Ronaldo duly buried the header.
The Real Madrid forward threatened a second soon after, swivelling on the edge of the area and scuffing just wide after a powerful run from left-back Raphael Guerreiro. The Atlas Lions wasted numerous chances to level and saw two first-half penalty claims rejected by referee Mark Geiger, with VAR not used, much to the dismay of coach Herve Renard.
Morocco did well to insert its presence in the match following the early goal, but various chances from Medhi Benatia and Hakim Ziyech weren't enough to break past Portugal goalkeeper Rui Patricio.
Spain squeezed past dogged Iran in their World Cup Group B encounter thanks to a fortuitous goal from Diego Costa, but the Europeans suffered a string of second-half scares. The Portuguese will face Iran in their final match on Monday in Saransk.