Youssef En-Nesyri's first-half header secured a historic win for Morocco, who will play defending champions France or England for a place in the final.
Morocco have surpassed the three other African sides to reach the quarter-finals -- Cameroon in 1990, Senegal in 2002 and Ghana in 2010.