The Real Madrid star struck from the penalty spot on 33 minutes to fire the European champions in front before Bernardo Silva turned in a second goal four minutes later.
Andre Silva added a third on 80 minutes before Nani completed the rout in stoppage time to ensure Portugal progressed to the last four as winners of Group A, finishing above Mexico on goal difference.