An Iranian court has sentenced six young Iranians to prison plus 91 lashes for producing a viral video of Pharrell William's hit single "Happy".

Five of the accused were given six-month prison sentences on top of the lashes, while the video's producer - Sassan Soleimani - was apparently given a year.

The sentences will however be suspended for three years, meaning that they will not be carried out if those convicted refrain from similar "offenses" during that period. After three years the sentences will then be voided.

The video drew ire from the country's Islamic authorities for portraying women and men dancing together to western music. The women also appeared without their hijabs (Muslim headscarves), which are mandatory in the Islamic Republic of Iran.

But their arrest sparked an international outcry, particularly after they were forced to make a televised confession, with Williams himself calling for their release. 

The court found them guilty of  "participation in the making of a vulgar clip" and "illegitimate relations between members of the group," according to the International Campaign for Human Rights in Iran.