A group of six Iranian youths who filmed a video dancing around to Pharrell's song 'Happy' were sentenced on Wednesday to six months in prison and 91 lashes. The director of the video, Sassan Solemani, got a longer one-year sentence and the same amount of lashes.

But the group had cause to celebrate, since the sentences are being suspended. That means, if they are not arrested again for three years the punishments will be dropped, their lawyer Farshid Rofugaran told Iran Wire.

'A suspended sentence becomes null and void after a certain period of time,' Rofugaran said. 'When it’s a suspended sentence, the verdict is not carried out, but if during this period a similar offense is committed, then the accused is subject to legal punishment and the suspended sentence will then be carried out as well.'

Scroll down for video

Sentenced: A group of six Iranian men and women were sentenced on Wednesday to six months in prison and 91 lashes, after appearing in a video dancing to Pharrell's 'Happy'. The three women pictured above in their interrogation video

Heads down: The director of the video received a longer one-year sentence and the same amount of lashes. The three men who appeared in the video pictured above. The sentences will be suspended which means if they stay out of 'trouble' over the next three years, they won't receive the punishment.

The group was arrested in May 2014, a month after the video went viral on YouTube. Iranian authorities allegedly found issue in the fact that the women were dancing alongside the men and not wearing a hijab.

During their time behind bars, the three men and three women were humiliated and forced to go on national television to apologize for the video, saying they had been tricked into doing it.

After making the confession, they were released on bail and some have even been able to travel in and out of the country, Rofugaran said.

The group now has a choice whether to accept the verdict or appeal.

'I will do what my clients want me to do. We are happy that both the prison sentences and the lashes are suspended,' he said.

The group has spent the last week in Tehran court for their trial.

Amnesty International UK's Head of Campaigns, Champa Patel, condemned the trial and told MailOnline: 'Arresting people for dancing in a video tribute to a song called Happy is taking things to a new level of dark irony even for the authoritarian Iranian authorities.

Popular: The group of three men and three women who appear in the video were arrested last May after it went viral on YouTube

Dismay: Pharrell expressed his sadness at the arrest of the young Iranians

Conservative: Iranian authorities objected to the women dancing with the men in the video, while not wearing hijabs

'Iran already stamps all over freedom of expression, banning the use of satellite dishes, filtering the internet, and jailing journalists, artists and film directors. The authorities should stop persecuting these people and drop this ludicrous case against them.'

The friends were arrested in May after police took offense at the video, which shows three men and three unveiled women dancing in the streets and on the rooftops of Tehran.

A description for the video said: 'We have made this video as Pharrell Williams' fans in 8hrs, with iPhone 5S. 'Happy' was an excuse to be happy. We enjoyed every second of making it. Hope it puts a smile on your face.'

Williams protested the arrests on Facebook, posting: 'It is beyond sad that these kids were arrested for trying to spread happiness.'