Morocco became the first African nation to reach a World Cup semi-final and ended the hopes of Cristiano Ronaldo's Portugal.
Striker Youssef En-Nesyri scored the winning goal in the first half, leaping highest to beat goalkeeper Diogo Costa to the ball and heading in to spark pandemonium at Al Thumama Stadium.
The north African side's supporters populated most of the venue and joyously celebrated their breakthrough moment on the global stage.
Ronaldo came off the bench in the 50th minute to equal the men's all-time appearance record of 196 in international matches, but he could not drag his side back into the contest.
Morocco, who will face England or France in the last four, were happy to play on the counter and grabbed the opener just before the break when En-Nesyri headed in from Yahya Attiyat-Allah's cross.
Portugal skipper Bruno Fernandes came agonisingly close to levelling just minutes later but a brilliant individual effort struck the crossbar.
Decimated by injuries, Morocco sat back for the majority of the second half and Yassine Bounou brilliantly tipped over Joao Felix's drive - the closest they came to an equaliser.
Morocco striker Walid Cheddira was sent off for a second yellow card in eight minutes of additional time but Portugal could not find the equaliser as their last-four hopes were dashed.
Magnificent Moroccans make history
Three African sides had previously reached this stage of the World Cup but none had progressed any further. Until now.
The marvellous Moroccan players and fans rejoiced as En-Nesyri's header on 42 minutes proved to be the pivotal moment.
Fans whistled and jeered every pass the Portuguese players made and then the rowdiest section behind the goal seemed to suck the ball into the net.
Walid Regragui's side were missing West Ham's Nayef Aguerd, Bayern Munich's Noussair Mazraoui and lost captain Romain Saiss to injury early in the second period.
But they defended resolutely and frustrated Portugal to keep their seventh clean sheet in eight games under their boss and have conceded just once in this tournament.
Morocco are a tough proposition and buoyed on by a partisan crowd in Doha, they will present a difficult challenge to whoever they face in the last four on Wednesday.
Goalkeeper Bounou, earning his 50th cap, pushed away a header from Felix early on and a deflected strike flew narrowly over.
Morocco had carved out the better opportunities on the break but En-Nesyri sent two free headers off target and Sofiane Boufal's curler was straight at Costa.
In his desperation for an equaliser, Fernando Santos sent on Ronaldo early in the second half but the 37-year-old - who equalled Kuwait striker Bader Al-Mutawa's international caps record - found it difficult to make any impact.
Having seen rival Lionel Messi reach the semi-finals on Friday, Ronaldo could not do the same with his side on what is likely to be his final World Cup appearance, trudging down the tunnel in tears at full-time as his dream was over.
Latest Stories
-
Europe’s flying taxi dreams falter as cash runs short
8 mins -
Al Fayed’s brother Salah also abused us, women say
21 mins -
I blame the Church for my brother’s death, says Zimbabwean sister of UK child abuser’s victim
40 mins -
South Africa cuts supplies to thousands of illegal miners hiding underground
54 mins -
Nigeria head five Afcon 2025 qualifiers as Ghana given hope
1 hour -
Trump’s pledge to axe the Department of Education explained
1 hour -
‘Major supplier’ of people-smuggling boats arrested
2 hours -
Meta fined €798m over ‘unfair’ Facebook Marketplace
2 hours -
UN climate talks ‘no longer fit for purpose’ say key experts
2 hours -
Conor McGregor admits ‘taking cocaine’ on night of alleged rape
2 hours -
Diamond necklace linked to Marie Antoinette sells for $4.8m
2 hours -
NADeF scholarship scheme turning aspirations into achievements
3 hours -
Seven ambassadors in Ashanti Region inducted for 2025 GSTEP Challenge
5 hours -
Investors don’t find Ghana’s oil field or upstream sector attractive anymore – Nana Amoasi VII
5 hours -
We’ll not accept these unscrupulous acts – Kwesi Kwarteng on alleged distribution of expired rice to SHSs
6 hours