Achraf Hakimi’s other amazing goal helped Morocco avoid annoyance against Malawi and advanced to the last eight.
Malawi took the lead in the seventh minute with an amazing goal from Gabadinho Mhango who crossed the left-wing and from 40 yards out hit the high net and hit the goalkeeper.
They came close to catching the lead until the break, only Youssef En-Nesyri reached the point in the second minute of the injury by climbing up the box to direct a header from home.
And Morocco completed the change with 20 minutes left as Hakimi hit his second freekick in the tournament for his country to pass.
It will face either Ivory Coast or Egypt in the next round.