Catch up on all the action and highlights from Portugal v Morocco now on the
Youssef En-Nesyri scored the winning goal in the 42nd minute in Sunday's (AEDT) quarter-final to continue Morocco's improbable run that has generated an outpouring of pride in the Arab world during the first World Cup to be staged in the Middle East.
The 37-year-old Ronaldo, one of the greatest-ever players, didn't start for the second straight game but came on as a substitute in the 51st minute and missed a chance to equalise in stoppage time.
The five-time Ballon d'Or winner is set to finish his career without capturing the World Cup or ever getting to the final.
He headed right off the field after the final whistle and was crying as he walked down the tunnel.
It is a seminal moment in World Cup history, with an African nation finally advancing to the levels typically only reached by European or South American teams.
Cameroon (1990), Senegal (2002) and Ghana (2010) all reached the quarter-finals but got no further.
And off the field, this Morocco squad — coached by French-born Walid Regragui and containing 14 players born abroad — is uniting the Arab world, inspiring displays in Arab identity from fans in different countries.
There's no reason why Morocco cannot go all the way to the title, either, after topping a group that included second-ranked Belgium and fellow semi-finalists Croatia, and now taking down two of Europe's heavyweights in Spain — after a penalty shootout in the Round of 16 — and Portugal.
Morocco's defence have yet to concede a goal by an opposition player at this year's World Cup — the only one they allowed was an own-goal — and they stifled a Portugal team which had beat Switzerland 6-1 in the last-16 to thrust themselves among the favourites.
In a game played to the backdrop of non-stop whistles and jeers by Morocco's passionate fans, the team relied almost exclusively on counter-attacks and scored from one of them.
A cross was swung in from the left and En-Nesyri leapt between floundering Portugal goalkeeper Diogo Costa and defender Ruben Dias to head into the empty net.
Ronaldo, who will be 41 by the time of the 2026 World Cup in the United States, Mexico and Canada, had been looking to reach the semi-finals for only the second time after 2006.
Try as he might, he barely got a touch of the ball until stoppage time when he got in behind Morocco's defence off a long ball forward.
But his low shot was saved by goalkeeper Yassine Bounou, who hadn't had too much to do before that point.
Substitute Walid Cheddira was shown a red card for Morocco in stoppage time for collecting a second yellow card in as many minutes. Portugal centre back Pepe then headed wide from inside the six-yard box.