Moroccan goals were scored by Abdessamad Ezzalzouli (23'), Soufiane Rahimi, who scored twice (26', 64'), Bilal El Khannouss (51'), Akram Nakach (73') and Achraf Hakimi (87').
Owing to this victory, Morocco has secured two medals at the Paris Olympics, following Soufiane El Bakkali's gold in the 3,000 steeplechase on Wednesday.
This is Morocco's first Olympic medal in football, joining athletics and boxing as sports having secured Olympic medals for the Kingdom.