The former European champions almost took the lead, but Yassine Bounou made a fine save to deny Joao Felix.
The Atlas Lions then took the lead through Youssef En-Nesyri.
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.
- NURTW warns members against rejecting old naira notes
- JAMB opens up on extending registration
- JAMB suspends CBT centre in Kwara for violating rules
- COVID-19 remains International health threat, WHO warns
- 59 confirmed dead and 157 injured in Pakistan mosque bomb blast
- Redesigned notes: Lagos residents groan as scarcity hits hard
- West Ham set up Man United tie by beating Derby
- No room for deadline extension, JAMB Registrar, Oloyede warns prospective applicants
- VIDEOS+PHOTOS: When Buhari visited Emir of Kano, Aminu Ado Bayero
- Abiola Bawuah becomes UBA CEO in Africa