Morocco search for their second-ever Africa Cup of Nations trophy gets a boost after they came from a goal down to inflict heartbreak on Malawi following a 2-1 win on Tuesday.
Malawi got the opener after just seven minutes through winger Hellings Mhango who produced a spectacular from almost 40 yards out.
But Morocco got the equaliser from Sevilla forward En Nesyri who headed in a cross from Amallah in the extra time of the first 45 to level things up before the break.
The North Africans came back stronger in the second half to produce a comeback through defender Achraf Hakimi scored another beautiful goal to send his side to the quarter-finals.
They will face Senegal in the quarter-finals who themselves defeated Cape Verde 2-0 earlier on in the first game of the day.