The six Iranian youths who were put behind bars for dancing in a YouTube version of Pharrell Williams' viral song Happy have been released on bail at around $100,000 each.

Tehran police ordered the arrests of three men and three women, who have an average age of 25, because they helped make an "obscene video clip that offended the public morals and was released on cyberspace".

However, Iranian reformist president Hassan Rouhani contradicted authorities with a surprise tweet:

Pharrell, whose hit was downloaded millions of times in the United States, condemned the arrest on his Facebook page, writing: "It is beyond sad that these kids were arrested for trying to spread happiness."

One of the Iranians arrested tweeted upon her release:

Iranian writer and broadcaster Kambiz Hosseini started a campaign on Twitter called #FreeHappyIranians on the same day of the arrests. Since then, the hashtag has been tweeted more than 9,000 times.

Pharrell Williams
Pharrell led the outcry against the arrests.Getty