Morocco knew defeat would spell the end of their 2018 World Cup hopes and they were outstanding for most of the encounter, dominating possession against Fernando Santos defensive-minded outfit.
However, a lapse of concentration early on proved to be their undoing as Ronaldo headed home from close range in the fourth minute.
Ronaldo's fourth goal of the tournament and record 85th for Portugal separated the two sides in the end.
Herve Renard's Atlas Lions will no doubt be frustrated by the manner of their consecutive defeats after showing real promise but no end product in the final third - while goalkeeper Rui Patricio was in fine form for the European champions.
Portugal now move a single point above Iran in Group B, who play Spain this evening - while the North African remain without a point after two games.
Portugal XI: Rui Patrício, Cedric Soares, Pepe, Jose Fonte, Raphael Guerreiro, Bernardo Silva, Joao Moutinho, William Carvalho, Joao Mario, Goncalo Guedes, Cristiano Ronaldo.
Subtitutes: Anthony Lopes, Ricardo Quaresma, Adrien Silva, Andre Silva, Gelson Martins, Mario Rui, Beto, Ricardo Pereira, Bruno Fernandes, Manuel Fernandes, Bruno Alves, Ruben Dias.
Morocco XI: Munir Mohamedi, Nabil Dirar, Medhi Benatia (c), Manuel da Costa, Achraf Hakimi, Karim El Ahmadi, Moubarak Boussoufa, Nordin Amrabat, Younes Belhanda, Hakim Ziyech, Khalid Boutaib.
Substitutes: Amine Harit, Ayoub El Kaabi, Youssef En-Nesyri, Mehdi Carcela-Gonzalez, Faycal Fajr, Hamza Mendyl, Sofyan Amrabat, Ahmed Reda Tagnaouti, Romain Saiss, Aziz Bouhaddouz, Bono.