CASABLANCA — Whenever there is a soccer game in Casablanca, the town descends into chaos as dozens of supporters of the city’s two teams, Wydad and Raja Club Athletic, and their opponents storm through the city center leaving a trail of destruction in their wake. But after a soccer riot last month resulted in the death of Hamza Baqqali, 21, Morocco is doing some soul-searching about the causes of increasing hooliganism and ways to prevent it.

Soccer violence waxes and wanes in various countries, but this scourge has reached Morocco only in recent years. It is still mainly limited to Casablanca — the country’s largest city and economic capital.

Casablanca’s stadiums have become battlegrounds, attracting teenagers from underprivileged neighborhoods with nothing to lose, acting out their anger.

The destructive mob behavior seems to be the result of decades of failure in the education system and of the country’s inability to give hope to its disenchanted youth.