Morocco defeated Portugal 1-0 on Saturday to become the first nation to advance to the World Cup semifinals.
Former European champions came close to taking the lead, but Joao Felix was stopped by a superb save from Yassine Bounou.
Youssef En-Nesyri then gave the Atlas Lions the lead.
The Sevilla striker rose highest to head past a stranded Diogo Costa.
It proved to be the only game of the encounter, as the North Africans repelled the Portuguese onslaught to create history.
Morocco will now play either France or England for a place in the final.