Seven young Iranians seen dancing in video that went viral handed suspended sentences of jail and 91 lashes each

A group of Pharrell Williams fans who were arrested for filming themselves dancing to the Pharrell Williams song Happy on the rooftops of Tehran have received suspended sentences of imprisonment and lashes.

According to the International Campaign for Human Rights in Iran (ICHRI), a New-York based non-profit organisation, an Iranian court sentenced six of those involved – including the director, Sassan Soleimani – to six months in prison and 91 lashes. A seventh participant, Reyhaneh Taravati, received an additional six months on her prison sentence for possession of alcohol and her role in distributing the video.

The group were arrested in May after the clip, Happy in Tehran, drew thousands of online viewers. A Tehran court found them guilty of producing a "vulgar" video and conducting "illicit relations".

The group – Soleimani, Taravati, Neda Motameni, Afshin Sohrabi, Bardia Moradi, Roham Shamekhi, and another identified only by the first name Sepideh – will serve their sentences only if they are found guilty of another crime in the next three years.

Soon after the seven were arrested they appeared on Iranian TV confessing to their crimes. Rights activists have long objected to this practice and consider such confessions to be made under duress and obtained for political purposes.

Tehran's police chief condemned the group's actions at the time and described the video as "obnoxious", but Iran's president defended the seven on Twitter. "Happiness is our people's right. We shouldn't be too hard on behaviours caused by joy," Hassan Rouhani's account tweeted.

The charges against the group, the ICHRI said, were based on information obtained from material confiscated during the raid on the individuals' homes, such as personal photographs and videos found on their personal computers.

After triggering an international outcry – including a tweet by the original Happy singer – all of those involved were granted bail, except the director, who was held until the end of May.

"This is unfair; imprisonment and lashes for what?" tweeted one Iranian. "Don't be happy in Iran, otherwise you'll be seen as having illicit relations," said another.