Morocco stunned Portugal to become the first African team to reach the semi-finals of the World Cup.
Youssef En-Nesyri’s header three minutes before half-time was the only goal of a 1-0 victory that was greeted with jubilation by the massed ranks of Morocco fans in the Al Thumama Stadium.
Cristiano Ronaldo was again left out of the starting line-up but came on early in the second half for his 196th international appearance, equalling the men’s world record of Kuwait’s Badr Al-Mutawa.
But he barely made an impact and ended what will surely be his final World Cup in tears as Morocco battled with energy and skill to achieve what previous quarter-finalists Cameroon, Senegal and Ghana could not.
Portugal made only one change from the 6-1 victory over Switzerland, Wolves midfielder Ruben Neves replacing William Carvalho, while Nayef Aguerd and Noussair Mazraoui were both injured for Morocco so Jawad El Yamiq and Yahya Attiat-Allah started.
Despite swathes of empty seats – fans reported chaotic scenes outside the stadium – the Moroccan supporters in the ground made it a rousing atmosphere from the start.
Deafening whistles greeted Portugal possession, and there was an early escape for the Atlas Lions when Joao Felix’s header from a free-kick was pushed away by Bono.
An impressive passing move led to the goal, with En-Nesyri producing a mighty leap to beat Diogo Costa to the ball and power a header into the net, causing bedlam in the stands.
Portugal almost managed a quick reply through Bruno Fernandes’ audacious over-the-shoulder volley but the ball smacked against the bar.
It took only six minutes of the second half, during which Costa did well to beat away Hakim Ziyech’s free-kick, for Portugal boss Fernando Santos to turn to Ronaldo and Manchester City’s Joao Cancelo.
Portugal probed for an opening and Goncalo Ramos, the hat-trick hero against Switzerland but largely invisible here, headed wide before Fernandes was just off target with another well-struck effort.
Felix had been Portugal’s biggest danger and he drew a brilliant one-handed save from Bono with a shot from the edge of the box, while Pepe should have scored with the final chance of the match.
Morocco were reduced to 10 men in injury time when Walid Cheddira picked up two quick yellow cards but it was a minor blip on a historic day.