Morocco beat Canada 2-1 at Al Thumama Stadium on Thursday to secure a spot in the last-16 stage World Cup for the first time in 36 years.