Under Islam, no happiness will be allowed. In Iran, amateur dancers have been sentenced to up to one year in prison and 91 lashes after appearing in a joyous YouTube video tribute to Pharrell Williams’ song Happy.

Members of the group behind the video were arrested by Iranian police last May for violating Islamic laws, which prohibit dancing with members of the opposite sex and women from appearing without a headscarf.

After receiving more than 150,000 views, the “Happy we are from Tehran” video was brought to the attention of the Iranian authorities.

The defendants, four men and three women, were detained by police in May after six of them were shown lip syncing to Pharrell Williams’ hit song.

The case attracted international attention and the arrests drew condemnation from international rights groups, sparking a social media campaign calling for justice, and condemning the ugly and repressive persecution of the performers.

The video production, deemed indecent by the standards of Islam, shows the men and women, none of whom wore obligatory headscarves, dancing together in sunglasses and western style clothes on Tehran rooftops and alleyways.

The sentences are suspended for three years, meaning that if any of the seven is found guilty of a similar offence, the punishment is then carried out, defence attorney Farshid Rofugaran told the AP news agency on Friday.

Rofugaran said the suspended jail term was the punishment for acting in the video and the lashes were for ignoring Islamic norms.

Iranian police chief, Hossein Sajedinia, called the video “a vulgar clip” which “hurt public chastity” and urged Iranian youth to avoid such acts.

Watch the video. It is a beautiful and joyous expression: a refreshing reminder that Iranians, and by extension all Islamic people, are not always shrouded in darkness, are not always cowering in submission to a god that does not exist, are not always bound by ignorant and discredited religious superstitions.