TEHRAN, Iran — Six young Iranian men and women videotaped dancing to Pharrell Williams’ “Happy” and the homemade video’s director have been sentenced to suspended jail terms and lashes, their lawyer said Friday.

The Iranians’ case attracted international attention when they were detained in May for participating in a production deemed indecent by hard-liners in Iran.

The video showed the men and women, none of whom wore obligatory headscarves, dancing together in sunglasses and silly clothes on Tehran rooftops and in alleyways.

Lawyer Farshid Rofugaran said the seven received suspended sentences of six months in jail and 91 lashes each. He said the suspended jail term was punishment for acting in the video and the lashes were for ignoring Islamic norms.

The suspended sentences mean that verdicts against the defendants won’t be carried out unless they commit crimes and are found guilty in the next three years.

“My clients did act in a video and their actions are contrary to religious requirements but are not crimes to deserve legal punishment. Saying prayers is a religious obligation in Islam but no one gets jail terms for not saying prayers,” he told the Associated Press on Friday.

“The happy part of the verdict is that it’s a three-year suspended sentence. The verdicts won’t be carried out unless my clients are found guilty in a court of law for the next three years,” he said.

The lawyer said one of the defendants also received another suspended sentence of six months over charges of possessing alcohol, which is banned in Iran. He said one of his clients kept industrial alcohol needed for his job, which is legal, but did not possess alcohol to drink.

Rofugaran said he learned of the verdicts from the judge’s office and expects a formal announcement soon. He said he will have 20 days to appeal the sentence once he receives the written verdict.

The seven men and women were arrested in May but released soon afterward.

Laws in the Islamic Republic ban women from dancing in public or appearing outside without covering her hair with the hijab.

The arrests in May drew widespread criticism. Williams himself weighed in, tweeting at the time that it was “beyond sad these kids were arrested for trying to spread happiness.”

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

Hard-liners have accused moderate President Hassan Rouhani of failing to stop the spread of what they deem “decadent” Western culture in Iran. They’ve marched numerous times in Tehran streets to protest women not being sufficiently veiled and dressing provocatively.

While Rouhani pursues a policy of social and cultural openness, hard-liners say the government should be tough on those who challenge strict interpretations of Islamic norms. They accuse Rouhani of showing leniency and too much tolerance toward those who question Islamic sanctities.