Media playback is unsupported on your device Media caption The video shows people dancing to Pharrell's single in and around Tehran

A group of Iranian fans who created a tribute to Pharrell Williams' hit song Happy have been arrested.

The video shows three men and three unveiled women dancing to the song on the streets and rooftops of Tehran.

Police chief Hossein Sajedinia said the "vulgar clip" had "hurt public chastity", the ISNA news agency said.

Iran's state-run TV broadcast a programme on Tuesday, apparently showing the men and women confessing on camera.

A subtitled edition of the TV clip, posted on YouTube, identified the detainees as "actors" who claimed they were tricked into making the Happy video for an audition.

Analysis The young people in the video are students, film-makers and photographers. Their video appeared during the Persian New Year, at the end of March, and it was an instant hit on Iranian social media sites, inspiring several copies. It is just the latest example of young Iranians using the internet to challenge the restrictions on their everyday lives. In the past month, hundreds of Iranian women have been defying the rules requiring them to cover their heads in public, by sending photographs of themselves without headscarves, to a newly created Facebook site called "My Stealthy Freedom". Arash Sobhani, leader singer of the Iranian underground rock group Kiosk, who now lives in the US told BBC Persian that the Iranian authorities continuing attempts to crackdown on "un-Islamic" behaviour were not working. "They banned our music, broke our guitars, attacked our parties and stopped our concerts," he said. "But did we stop? No!"

"They told me they are making a feature film and they had a permit for it," said one man in the video. "They said those things and they fooled me."

Another young woman added: "They had promised us not to publish the video."

According to some unconfirmed reports, a total of 13 people were arrested in connection with the video, but official sources have not confirmed the exact number of detainees.

Williams, whose song was nominated for an Oscar earlier this year, has protested at the arrests.

"It is beyond sad that these kids were arrested for trying to spread happiness," the singer wrote on his Facebook page.

Iran's president Hassan Rouhani also appeared to criticise the arrest.

A unofficial twitter account, widely believed to be associated with the President, posted a comment he first made last year, saying: "#Happiness is our people's right. We shouldn't be too hard on behaviours caused by joy."

Under Iran's interpretation of Islamic law, women must cover their hair and wear loose-fitting clothing meant to preserve their modesty.

Patrols of so-called "morality police" regularly enforce standards of Islamic dress on Iran's streets. However, the rules are widely flouted.

The internet is also heavily filtered in Iran, with the authorities blocking access to popular social networking sites.

The "Happy we are from Tehran" video, originally posted in March, has now been seen more than 40,000 times.

Image copyright YouTuvbe Image caption The video has been watched more than 40,000 times

Image copyright Reuters Image caption Williams performed the song at the Oscar ceremony in March

At the end of the clip, the credits read: "Happy was an excuse to be happy. We enjoyed every second of making it. Hope it puts a smile on your face."

Thousands of Iranians have been arrested in the past 35 years for being happy [and] partying Golnaz Esfandiari, Iranian jouralist

Iranian journalist Golnaz Esfandiari tweeted in response to the arrests: "Iran [is] a country where being 'happy' is a crime.

"Thousands of Iranians have been arrested in the past 35 years for being happy [and] partying."

Arash Sobhani, leader singer of the Iranian underground rock group Kiosk, told the BBC's Persian service that attempts to suppress musicians were not working.

"They banned our music, broke our guitars, attacked our parties and stopped our concerts," he said. "But did we stop? No!"

Many Twitter users have begun using the hashtag #freehappyiranians to put pressure on the Iranian authorities to release those arrested over the video.

Image copyright YouTube Image caption The participants are now believed to have been released on bail

Williams' song has inspired hundreds of tributes since it was released last year on the soundtrack to hit animation Despicable Me 2.

The music video lasted an exhausting 24 hours - with dozens of people filmed lip-syncing and dancing to the feel-good anthem, which was played on a loop.

The clip sparked a YouTube craze, with thousands fans around the world staging their own performances of the song.

When shown a montage of the tributes on the Oprah Winfrey show last month, Williams began to cry, saying the response to the song had been "overwhelming".

In the UK, the track has reached number one on three separate occasions, while in the US it spent 10 weeks at the top of the Hot 100.