Six Iranians arrested for appearing in a video singing along to an American pop song were released today.
It comes one day after they were detained for what police called their "obscene" behaviour, one of them said in an online posting.
In the clip, the three women and three men dance to Pharrell Williams' "Happy", imitating the official video of the international hit.
The women are not wearing headscarves, as demanded by Iran's Islamic law.
Their arrest caused outrage among fans of the song, who took to social media to denounce what they saw as a heavy-handed response by the Islamic Republic to a piece of harmless fun.
Pharrell Williams himself criticised the arrests. "It's beyond sad these kids were arrested for trying to spread happiness," he tweeted yesterday.
The incident has highlighted the struggle between Iran's conservatives and those who hope President Hassan Rouhani, who has eased the country's antagonistic stance with the West, might also relax the Islamic Republic's social norms.
Iran's state-run TV broadcast a programme yesterday, apparently showing the six expressing regret.
"They had promised us not to publish the video," said one of the women.
Tehran's police chief, Hossein Sajedinia, said he had ordered the arrest of the six youngsters because they had helped create an "obscene video clip that offended the public morals and was released in cyberspace," the ISNA news agency said.
A source close to the six said they had been released on bail.
"Hi, I'm back, thank you @ pharrell and everyone who cared about us," Reihane Taravati wrote on her Instagram account. "Love you all so much and missed you so much."
In a tweet today, the president, who has championed internet freedoms in a country that has sweeping bans on social and news media sites, appeared to express support for the six.
"#Happiness is our people's right. We shouldn't be too hard on behaviours caused by joy," he wrote on his English language Twitter account, without specifically saying he was referring to the video.
It is not the first time young Iranians have used social media sites to buck social restrictions.
A Facebook page entitled "My Stealthy Freedom", where Iranian women can send in pictures of themselves without their hair covered, has garnered 331,000 likes.
"They arrested the 'Happy' kids because it was easier than arresting women from that Facebook page," said a young Iranian from Tehran.