As she sat on the train to the Hay festival late last month, the London-based Turkish novelist Elif Shafak received a chilling telephone call from her editor in Istanbul. She was told that police officers had entered the publishing house and taken copies of her books to a prosecutor, who planned to scour them for evidence of her having committed a “crime of obscenity” by writing about, for example, sexual harassment or child abuse. At the same time, the writer witnessed an avalanche of abusive and misogynist messages directed at her on social media – digital intimidation to accompany harassment by the authorities.

The targeting of novelists in this way marks a new nadir in the Turkish government’s persecution of journalists, intellectuals, writers and academics. As Shafak has pointed out, the supreme irony is that real-life violence against women and girls is a desperately serious problem in Turkey. According to United Nations figures, 38% of Turkish women experience physical or sexual violence from a partner. Women murdered by a partner or a family member numbered 409 in 2017, up from 237 four years previously, according to the group We Will Stop Femicide. Self-evidently, the authorities ought to be investigating real violence against women and girls, not novelists legitimately pursuing their art. But there seems little hope of this. In 2016 the government introduced a bill clearing statutory rapists of their crime if they married their victims. Back in 2014 Turkey’s president, Recep Tayyip Erdoğan, declared: “You cannot put women and men on an equal footing. It is against nature.” He has also called childless women “deficient, incomplete”.

Long before the attempted military coup against Mr Erdoğan’s government in July 2016, press and artistic freedom was seriously under threat in Turkey. Anti-defamation and anti-terrorism laws had been used aggressively to target journalists and writers. Shafak herself was tried and acquitted in 2006 of “insulting Turkishness” because one of the characters in her novel The Bastard of Istanbul referred to the massacre of Armenians in the first world war as genocide.

After the coup attempt, Mr Erdoğan, to quote Turkish journalist Ece Temelkuran, “turned a crisis into an opportunity”, and transformed this pressure into a full-scale purge. In the months afterwards, 150 media outlets were forcibly closed. In May, Amnesty described Turkey as “the world’s largest prison for journalists”. The targeting of Shafak’s novels is just another twist in this tale of paranoia and repression.

On 23 June, local elections in Istanbul will be rerun after Mr Erdoğan’s ruling AK party cried foul when March’s original ballot narrowly returned an opposition politician as mayor. At this moment in particular the international community must stand in solidarity with those Turks who, despite everything, still hope that the lineaments of their country’s civil society have not been permanently damaged.