An Istanbul court Monday moved one of Turkey's biggest pop stars from jail to house arrest pending trial on charges of "inciting hatred" by making a joke about religious schools.
Gulsen Bayraktar Colakoglu, 46, who uses her first name on stage, was jailed last Thursday, sparking an outcry from her legion of fans and President Recep Tayyip Erdogan's political foes.
Although she made the joke on stage in April, it went viral on social media after being re-posted by a pro-government daily last week.
Top members of Erdogan's Islamic-rooted party then voiced moral outrage, turning her joke into another divisive issue roiling the polarised country 10 months before crunch national polls.
Gulsen had quipped that her guitarist's "perversion" was rooted in his upbringing in an Imam Hatip school, which specialises in religious education combined with a modern curriculum.
Erdogan himself went to such a school.
"Our Imam Hatip schools came under attack from serious threats," Erdogan told one of his daily rallies a few hours after Gulsen's release.
"For years, they tried to exclude my people," he said in reference to decades of staunchly secular Turkish rule.
"They were trying to intimidate and frighten our people, whom they insulted and called stupid... We will be vigilant and not allow ourselves to be subjugated to that again."
Turkey is a predominantly Muslim but officially secular state.
Tensions between the two sides of Turkey's national identity have been the defining feature of the modern republic that emerged from the ruins of the Ottoman Empire a century ago.
Gulsen was swarmed by reporters but did not speak as security guards guided her from a woman's prison to a waiting van.
"We are very happy about the decision," Gulsen's lawyer Emek Emre said outside the courtroom, while adding that placing his client under house arrest was "incompatible with the law".
- LGBTQ icon -
Most Imam Hatip schools were closed after the 1997 ousting of an Islamic-rooted government by the military.
Their number began to grow when Erdogan's ruling Justice and Development Party (AKP) came to power in 2002.
Erdogan has often said his goal was to raise "pious generations".
This creates enormous tensions with more liberal Turks, who fear that Erdogan's rule is undermining the republic's secular foundations.
Gulsen said she was sorry that her joke was being used to stir up further divisions.
"I am sorry that my words gave material to malicious people who aim to polarise our country," she said on her social media accounts before being placed behind bars.
Gulsen emerged in the 1990s, with her first video clip featuring her in pyjamas.
Her songs and videos became more risque and overtly sexual with time.
This year, she dedicated her Elle Style "icon of the year" award to the LGBTQ movement.