ANKARA, Turkey (AP) — A Turkish court on Monday released pop star Gulsen from jail but placed her on house arrest as she awaits trial on charges of “inciting hatred and enmity” for a joke she made about Turkey’s religious schools.

Last week, the 46-year-old singer and songwriter, whose full name is Gulsen Colakoglu, was taken away from her home in Istanbul for questioning, and ordered arrested and jailed pending a trial. Her arrest sparked outrage on social media and deepened concerns about the Turkish judiciary, whose independence has been questioned by opposition parties.

The charges were based on a joke the singer made during an April concert, where she quipped that one of her musicians’ “perversion” stemmed from attending a religious school.

Acting on a request submitted by Gulsen’s lawyer, an Istanbul court released her from jail on the condition that she not leave her home, the state-run Anadolu Agency reported. The court cited the fact that the singer has a small child to look after, is not a flight risk and was unlikely to tamper with evidence, the agency said.

Gulsen’s lawyer, Emek Emre, said he welcomed the fact that Gulsen would “spend the night at her own home with her child,” but said he would also seek her release from house arrest.

Government critics said the singer’s arrest was an effort by Turkish President Recep Tayyip Erdogan to consolidate support from his religious and conservative supporters ahead of an election next year.

The singer had previously become a target in Islamic circles due to her revealing stage outfits and for unfurling an LGBTQ flag at a concert. A video of the singer’s comment on religious schools began circulating on social media recently, with a hashtag calling for her arrest.

Erdogan and many members of his Islam-based ruling party are graduates of religious schools, which were originally established to train imams. The number of religious schools in Turkey has increased under Erdogan, who has promised to raise a “pious generation.”