Ronaldo, 33, became the oldest scorer of a hat-trick in World Cup history and just the fourth player to find the back of the net at four different editions of the tournament.
It was his fourth goal in five attempts from the two matches played in FIFA World Cup 2018 and with that being his 85th global goal, Ronaldo surpassed Hungarian legend Fren Puskas to become leading European goalscorer in the history of football.
He scored a hat trick against Spain including an unbelievable bending free kick with minutes left in the match to secure a 3-3 draw.
Herve Renard's side were sunk by a late Iran goal in their opening game and know they need a win to salvage their hopes of getting out of the group.
They didn't go without a fight, though, with Rui Patricio in sparkling form in the Portugal goal. Iran have three points and Spain one ahead of their meeting later today.
With matches against Portugal and then Spain still to come, Morocco's chances of progression to the knockout stages are looking very slim.
Injured in Osaka, Japan earthquake
Japan lies in a particularly earthquake-prone region and accounts for around 20% of quakes worldwide of magnitude 6.0 or more. The Japanese government had not received reports of major damage as of 8.30am, spokesman Yoshihide Suga told reporters.
Morocco are the first team to be eliminated from the 2018 World Cup.
Him again. Cristiano Ronaldo broke the ice four minutes into the game, with the sort of diving header perilously inches from Karim El Ahmadi's boot that screamed: BY ANY MEANS NECESSARY.
The defeat means Morocco are out of the competition as they have lost their opening two fixtures and can not qualify for the last 16.
The Portugal captain met Joao Moutinho's cross to head home in the fourth minute at the Luzhniki Stadium in Moscow, sealing a 1-0 win for the reigning European champions. Just like they did en route to winning Euro 2016, Portugal were belligerent rather than handsome here, with none of Ronaldo's teammates truly stepping up along with him.
Central defender Medhi Benatia looked impressive against Iran, and the experience of the Juventus man is going to be crucial if Morocco is to get their World Cup back on track.
The match took place at the Luzhniki Stadium in Moscow, Russia.