(CNN) -- Ugandan authorities jailed a British producer for staging without permission a play about the challenges facing homosexuals in the African nation.
Homosexual acts are illegal in Uganda, where most gays and lesbians face physical attacks and are treated as social outcasts.
The east African nation has made headlines after a parliamentarian introduced an anti-gay bill that called for death for certain homosexual acts.
David Cecil, the producer, spent four days in detention before he was released on bail, his lawyer said Thursday.
He faces charges of "disobedience of lawful orders" after the nation's media council ordered him not to stage his play in public without authorization. If convicted, he can be imprisoned for two years.
"As I understand, the communique from the media council was he should not stage the play in any public theater in Uganda -- meaning he could do in private," said John Onyango, his lawyer. "That was the interpretation."
Cecil staged the play at two small bars in the capital of Kampala by private invitation, according to the lawyer.
CNN attempts to reach the Ugandan department of public prosecutions were unsuccessful.
The play, "The River and the Mountain," features an all-Ugandan cast, and tells the story of a gay businessman killed by his employees.
It uses the life of its main character -- a young businessman whose friends desert him after his revelation that he's a homosexual -- to highlight the challenges of gays in Uganda.
The character's mother unsuccessfully intervenes to "cure" him of his homosexuality, and his colleagues later kill him.
"The play is about the interaction of politics, religion, sexuality and identity," Cecil said by phone from the capital. "The plot hinges on the betrayal of the hero by his best friend."
Cecil is free on $200 bail. He surrendered his passport and is scheduled to appear in court October 18.
Though he faces imprisonment if found guilty, the producer said the incident does not change his love for the nation.
"I love Uganda, I think it's a fantastic country," he said.
He described the jail he was held as "a clean and sociable" place, saying he was treated well.
"I was very well fed ... It was like a strict boarding school," he said.
In 2009, a parliamentarian introduced an anti-gay bill that imposes a death sentence on those convicted of certain homosexual acts, but lawmakers shelved it this year.
World leaders condemned the proposal, prompting some nations to threaten to withhold aid to Uganda.
The member of parliament backing the legislation has vowed to re-introduce it.