"A suspect was arrested for assaulting a young man, who was undressed, for his assumed homosexuality, and another two were arrested for trying to blackmail the victim's family with a video," Casablanca police said.
Online newspapers on Friday night posted footage showing individuals beating a young man wearing women's underwear, before undressing him completely while threatening to kill him.
From the video, police managed to identify the victim -- a 17-year-old -- and determine that the attack had occurred on Wednesday in a Casablanca neighbourhood, news agency MAP quoted the police as saying.
A 23-year-old has been detained for his suspected implication in the assault, while two others aged 19 and 20 have been apprehended for allegedly blackmailing the victim's family.
Signup to our newsletter and follow us on Facebook and Twitter!
The police are still looking for others, as a witness said they saw four attackers.
The arrests come after a Moroccan court in August sentenced two men to four months in jail for beating up a presumed homosexual because of his appearance.
Some 70 lawyers mobilised to represent the victim, after a video emerged showing the victim collapsing to the ground under an avalanche of blows.
Homosexual activity is punishable by up to three years in jail in Morocco.
After a string of controversies over homosexuality, two men were jailed for four months in June for kissing in public in Rabat.