DOHA, Qatar (AP) – Africa finally has a team in the World Cup semifinals, and so does the Arab world. Morocco delivered a seminal moment in the nearly 100-year history of soccer’s biggest tournament, beating Cristiano Ronaldo and his Portugal team 1-0 Saturday in another shocking result in the first World Cup staged in the Middle East.

While a tearful Ronaldo headed right down the tunnel and maybe into international retirement after the final whistle, Morocco’s players tossed their coach in the air and waved their country’s flag as they linked arms in front of celebrating fans. “Pinch me, I’m dreaming,” Morocco goalkeeper Yassine Bounou said. “Morocco is ready to face anyone in the world. We have changed the mentality of the generation coming after us. They’ll know Moroccan players can create miracles.”

Youssef En-Nesyri scored the winning goal in the 42nd minute to continue an improbable run that has generated an outpouring of pride in the Arab world, inspiring displays of Arab identity from fans in different countries.

Africa is also rejoicing at finally having a nation 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. Morocco has broken through, setting up a semifinal match against either France or England.

Morocco’s Youssef En-Nesyri, right, scored the winning goal in the 42nd minute of Saturday’s match at Al Thumama Stadium in Doha, Qatar. (AP Photo/Martin Meissner)

The 37-year-old Ronaldo, one of soccer’s greatest players but now a fading force, didn’t start for the second straight game and came on as a substitute in the 51st minute. He missed his only 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 walked right off the field after the final whistle, only briefly stopped by two Morocco players wishing to shake his hand and a spectator who confronted him near the entrance to the tunnel and was crying as he headed to the locker room.

If this is the end for Ronaldo at the international level, he’ll finish with 118 goals a record in men’s soccer, and a European Championship title but not soccer’s biggest prize. He only got as far as the semifinals at the World Cup, in 2006. “Our players are distressed,” said Portugal coach Fernando Santos, who shrugged off questions about his own future and added that he didn’t regret not starting Ronaldo. “Cristiano is a great player and he came on when we thought it was necessary. But no, no regrets.”

There’s no reason why this Morocco squad — coached by French-born Walid Regragui and containing 14 players born abroad — cannot go all the way to the title. They topped a group that included second-ranked Belgium and fellow semifinalist Croatia and have now taken down two of Europe’s heavyweights in Spain — after a penalty shootout in the round of 16 — and Portugal in the quarterfinals. “Why shouldn’t we dream of winning the World Cup?” Regragui said. “If you don’t dream, you don’t get anywhere. It doesn’t cost you to dream.”

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 that 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, 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 Bounou. “I was afraid he might play,” Regragui said of Ronaldo, “because I know he can score out of nothing.”

Morocco’s goalkeeper Yassine Bounou, right, makes a save in front of Portugal’s Cristiano Ronaldo during the World Cup quarterfinal soccer match. (AP Photo/Luca Bruno)

Substitute Walid Cheddira was shown a red card for Morocco early in stoppage time for collecting a second yellow card in as many minutes. After Portugal center back Pepe headed wide from inside the six-yard box in the sixth minute of added time, 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. Morocco, meanwhile, might have to cope without its two starting center backs in the semifinals. Nayef Aguerd missed the game against Portugal with a thigh injury and Romain Saiss, Morocco’s captain, was carried off on a stretcher with a suspected left hamstring injury. Another key member of the defense, left back Noussair Mazraoui, was absent because of an illness while Regragui said right back Achraf Hakimi has been playing with an injury.