Footage on Moroccan media showed the fans charging at each other.
Two people were killed and 54 injured in Morocco's largest city on Saturday when rival fans of its Raja de Casablanca football club brawled after a home game.
The running battles, in which fans threw flares and ripped up parts of the Mohammed V stadium, came despite a 2-1 victory for the home team over Chabab Rif Al Hoceima of Al Hoceima in northern Morocco.
Footage on Moroccan media showed the fans -- dressed in the club's green colours -- charging at each other. It was unclear how the clashes had erupted.
The country's DGSN security service said in a statement that 31 people were arrested after the match for involvement in "acts of vandalism". Ten people had been arrested prior to the game for the same reason, it said.
A member of the Moroccan emergency personnel carries an injured supporter
Prosecutors have opened an inquiry into the fan trouble.
Following the violence, the Moroccan football federation's disciplinary commission penalised Raja by forcing them to play their next five matches in the tournament behind closed doors.
They were also fined 100,000 dirhams (9,000 euros) and could face compensation claims following the damage to the stadium.
Rival supporters often clash during Moroccan football matches.
A year ago a man died in the central city of Khouribga during clashes between supporters of the local club and of Raja de Casablanca. In 2013 more than 200 people were arrested after clashes broke out in Casablanca between fans of Raja and FAR Rabat.
Rival fans of Raja de Casablanca football club clash at the end of a football match between their team and Chabab Rif Al Hoceima
Moroccan youths lie on the pitch of the the Mohammed V stadium in Casablanca following the clashes
A member of the Moroccan security forces carries an injured supporter
An injured supporter receives treatment at a hospital in the Moroccan city of Casablanca
Moroccan youths lie on the pitch of the the Mohammed V stadium
Moroccan emergency personnel carry an injured supporter following the deadly clashes
Injured supporters wait for treatment at a hospital in the Moroccan city of Casablanca