Rabat - A Moroccan court sentenced two men to four months in jail on Thursday for beating up a presumed homosexual man because of his appearance, a rights group said.
The verdict was delivered by a court in the central city of Fez where a crowd of angry youths assaulted a man in July, accusing him of being a homosexual.
Mustapha Jebbour, of the Moroccan Association of Human Rights, said the pair were also ordered to pay a fine of 500 dirhams (around R700).
The men were arrested after websites posted a video of the victim trying in vain to take shelter in a taxi to escape a crowd.
The man is seen collapsing to the ground under an avalanche of blows.
Also Read: Man suffocates trying to enter Spain in suitcase
He finally gets to his feet, clothes torn, and tries of take cover in a shop before a policeman appears and holds up his gun to disperse the crowd.
The footage triggered outrage in Morocco, with people taking to social media to denounce the assault and one website, Le360, comparing the attack to the "barbarity" of the Islamic State group.
Some 70 lawyers mobilised to represent the victim, who Jebbour said "is still in shock and needs psychological support".
Following the arrest of the two men, the justice ministry vowed to "deal firmly" against "those who stand in for the law".
Homosexuality is punishable in Morocco by up to three years in jail. A divisive law - known as Article 489 - has been the subject of several protests, including a recent topless demonstration by feminist group Femen in the capital.
After a string of controversies over homosexuality, two men were jailed for four months on June 19 for kissing in public in Rabat. They were convicted of an "affront to public decency" and an "unnatural act with a person of the same sex".