With both sides failing to win their opening Group B match, there was a tense atmosphere inside Luzhniki Stadium prior to kick-off.
Morocco went on to lose the game 1-0, becoming the first team to be eliminated from the global tournament.
The pair are well clear of the third highest scorer for a European country - World Cup legend Miroslav Klose scored 71 goals for Germany between 2001 and 2014.
Morocco end their World Cup campaign against Spain on June 25, looking to sign out of Russian Federation with at least a goal to their name. Bernardo Silva chose to take a short corner with the help of Joao Moutinho, who crossed a teasing ball to the six-yard box.
Morocco, in their first finals appearance for 20 years, regrouped well and showed some real positivity in attack with Hakim Ziyech and Nordin Amrabat seeing plenty of the ball but Portugal generally defended well to limit the danger.
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.
Coach Herve Renard was also ticked off for the new offence of gesticulating to demand a video assistant referee (VAR) review of the incident, which left Amrabat with rugby-style stud-rake marks on his stomach that he insisted on displaying to anyone who would look.
Ronaldo's four goals top the individual scoring chart at the World Cup. The Portuguese will face Iran in their final match on Monday in Saransk.
The most important thing for our team is for Cristiano Ronaldo to be well.
Morocco continued to carve out opportunities as Patricio clung on well to a curling Belhanda shot, and the Portugal keeper pulled off an even better save minutes later.
Win or draw, and they'll remain a chance of advancing.
"The Danish, they are a strong team", van Marwijk told reporters.