Achraf Hakimi scored a brilliant free-kick to send Morocco through to the quarter-finals of the Africa Cup of Nations after a 2-1 win over Malawi on Tuesday.
Gabadinho Mhango gave outsiders Malawi, playing their first ever knockout game at the tournament, a shock early lead with a stunning goal from 40 metres at Ahmadou Ahidjo stadium.
But Youssef En-Nesyri headed Morocco level in first-half stoppage time before Hakimi drilled in the winner on 70 minutes to set up a meeting with Egypt or Ivory Coast in the last eight.
“When you win you get respect,” said Morocco coach Vahid Halilhodzic.
“Malawi scored a fantastic goal. I think we played really well in the first half, unfortunately we lacked efficiency. We had around 10 chances you can’t miss.
“But I was always confident. The team was upset but I knew at some point we would score a second goal. We controlled the match and we more than deserve to qualify.”
Morocco’s quarter-final tie was due to take place at Olembe Stadium in Yaounde but will be moved after a fatal crush outside the ground on Monday which killed eight people and injured 38.
As with the earlier match between Senegal and Cape Verde in Bafoussam, a minute’s silence was observed before kick-off and players of both teams wore black armbands.
Morocco, bidding for a second Cup of Nations title and first since 1976, fell behind on seven minutes when Mhango caught Yassine Bounou off his line with a superb long-range strike.
The Atlas Lions responded by creating a series of chances as Imran Louza stung the palms of Charles Thomu, who then did well to keep out Hakimi’s powerful free-kick and the follow-up from Louza.