Portugal's Otavio celebrates with team mates after the World Cup quarterfinal soccer match between Morocco and Portugal, at Al Thumama Stadium in Doha, Qatar, Saturday, Dec. 10, 2022. Credit: Martin Meissner / AP

DOHA, Qatar — Morocco became the first African country to reach the World Cup semifinals by beating Portugal 1-0 on Saturday, likely ending Cristiano Ronaldo’s chances of ever winning soccer’s biggest prize.

Youssef En-Nesyri scored the winning goal in the 42nd minute 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 soccer’s greatest players, didn’t start for the second straight game but came on as a substitute in the 51st minute and missed a chance to equalize in stoppage time.

The five-time world player of the year 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.

Morocco will play either France or England in the semifinals.

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 quarterfinals 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 semifinalist Croatia and now taking down two of Europe’s heavyweights in Spain — after a penalty shootout in the round of 16 — and Portugal in the quarterfinals.

Morocco’s defense has yet to concede a goal by an opposition player at this year’s World Cup — the only one it has allowed was an own-goal — and it stifled a Portugal team which beat Switzerland 6-1 in the last 16 to thrust itself among the favorites.

In a game played to the backdrop of non-stop whistles and jeers by Morocco’s passionate fans, the team relied almost exclusively on counterattacks and scored from one of them.

A cross was swung in from the left and En-Nesyri leapt between 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 semifinals 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 defense off a long ball forward. 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 center back Pepe then headed wide from inside the six-yard box.

Ronaldo fell to his knees in dejection. While Lionel Messi will be in the semifinals with Argentina, the other soccer great of this generation won’t be.