One of Turkey's biggest pop stars was moved from jail to house arrest on Monday 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 by a court in Istanbul last Thursday, sparking an outcry from her legion of fans and President Recep Tayyip Erdogan's political foes.
Although Gulsen made the joke on stage in April, it finally went viral on social media last week after being re-posted by a pro-government daily.
Top members of Mr Erdogan's Islamic-rooted party then voiced moral outrage, turning her joke into another divisive issue in 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.
Mr Erdogan went to such a school.
"Our Imam Hatip schools came under attack from serious threats," Mr 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.
Tension between the two sides of Turkey's national identity have been the defining feature of the modern republic that emerged from 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," her lawyer Emek Emre said outside the courtroom.
Mr Emre said that placing his client under house arrest was "incompatible with the law".
Most Imam Hatip schools were closed after the 1997 removal of an Islamist government by the military.
Their number began to grow when Mr Erdogan's ruling Justice and Development Party came to power in 2002.
Mr Erdogan has often said his goal was to raise "pious generations".
This creates enormous tension with more liberal Turks, who fear that Mr 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 put 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.