The 26-year old opened the scoring five minutes into the second half at the Houston Stadium.
He doubled the advantage eight minutes from the end following a counter-attack.
Soufiane Rahimi added the gloss in stoppage time.
History for Morocco
The victory madeMorocco the first team from Africa to reach the quarter-finals twice.
The loss ends a historic run for the Canadians who won their first match in a knockout round when they overcame South Africa in the last 32.
Morocco, who lost in the semi finals at the 2022 World Cup to France, could play them in the last eight if Didier Deschamps' men see off Paraguay on Saturday night in Philadelphia.
Hot in Philadelphia
The match will be played against a backdrop of extreme heat warnings.
Temperatures in the city hit 38° celsius on Friday. The US National Weather Service warned of similarly high temperatures when the game kicks off.
The team will be prepared for the conditions, saidDeschamps on the eve of the clash.
"It is something we need to take into account, but I think every team has prepared for it. It can have an impact on all the teams," added the 57-year-old Frenchman
French firepower at World Cup
France have scored 13 goals in their surge to the last 16.
Paraguay distinguished themselves with the penalty shootout victory in the last 32 over Germany on 29 June.
Head coach Gustavo Alfaro said he was more concerned about France's attacking quartet of Kylian Mbappé, Ousmane Dembélé, Michael Olise and Désiré Doué than the weather though he did make a meteorological analogy when describing the French forwards.
"France are like an electrical storm," said Alfaro. "We need to be aware that the storm is coming and try to be prepared for the lightning bolts."


Ounahi stars as Morocco outclass Canada to advance to last eight at World Cup
Hezbollah, Hamas and Houthi officials attend funeral ceremonies for Iran's Khame...
World Cup 2026: Ounahi fires Morocco to quarter-finals with decisive brace
‘International law is our compass’ in global conflict, UN rights chief tells RFI
Government begins distribution of relief items to June 29 flood victims
Accra is technically a flat-lying area, drains alone can’t solve Accra floods — ...
FDA closes Italian Boy Lounge at Teshie following suspected illicit drug raid
Sierra Leone President commiserates with Mahama on June 29 flood disaster
I want to uphold my father's dying wishes, not to chase his properties — Adwoa S...