TEHRAN, Iran (AP) — Iranian authorities have detained two artists over a theatre production of Shakespeare's A Midsummer Night's Dream.

Cultural official Shahram Karami told the official IRNA news agency Monday that Iran's judiciary had ordered the detention of the play's director, Maryam Kazemi, and the manager of the theater that hosted it, Saeed Assadi.

Karami said both were taken into custody Sunday evening, after the broadcast of a video trailer about the work. He said it had caused a "misunderstanding," but did not elaborate, adding that a court had accepted to release the two on some $24,000 bail each.

A clip on social media showed female actors dancing with men as part of the trailer, an illegal act under the Islamic Republic's strict rules that forbid gender mixing and women dancing in public.

The play was on stage for seven nights before the detentions. The comic fantasy tracks the intertwined fates of four lovers and is one of Shakespeare's most popular plays, put on by theater groups and schools around the world.

The police forces and hardliners who dominate Iran's judiciary reject western culture in Iran.

In July, Iran detained Maedeh Hojabri, a teenage girl who posted dance videos online.

In 2014 authorities sentenced six young men and women to suspended prison terms after they appeared in a video dancing to Pharrell Williams' song "Happy."