While she personally finds Trump “offensive and bigoted”, Rowling said that his freedom to speak “protects my freedom to call him a bigot”, just as those critics who have claimed that she is trying to convert children to satanism with the Harry Potter books “are at liberty” to do so, and she is “free to explain that I’m exploring human nature and morality, or to say ‘you’re an idiot’, depending on which side of the bed I got out of that day”.

“If you seek the removal of freedoms from an opponent simply on the grounds that they have offended you, you have crossed a line to stand alongside tyrants who imprison, torture and kill on exactly the same justifications,” the novelist said. Rowling was at the Pen event to receive the 2016 Pen/Allen Foundation literary service award, an honour given to a writer who works to “oppose repression in any form and to champion the best of humanity”.

Rowling, who was honoured for her work as an advocate for women’s and girls’ rights and as a “fierce opponent of censorship”, was clear that the US presidential hopeful’s “freedom guarantees mine”.

“Unless we take that absolute position without caveats or apologies we have set foot upon a road with only one destination,” she told her New York audience. “If my offended feelings can justify a travel ban on Donald Trump, I have no moral grounds on which to argue that those offended by feminism, or the fight for transgender rights, or universal suffrage, should not oppress campaigners for those causes”.

Warning that the growing “intolerance of alternative viewpoints” is making her “most uncomfortable”, Rowling said the west sometimes takes its freedoms for granted. “I worry that we may be in danger of allowing their erosion through sheer complacency. The tides of populism and nationalism currently sweeping many developed countries have been accompanied by demands that unwelcome and inconvenient voices be removed from public discourse. It seems that unless a commentator or a television channel or a newspaper reflects exactly the complainant’s world view it must be guilty of bias or corruption.”

She ended her acceptance speech by pointing to the case of Tal Al-Mallouhi, who was arrested by Syrian security forces in 2009 over her blog entries. Al-Mallouhi was 18 at the time, and remains in prison.

Rowling quoted from one of Al-Mallouhi’s blogs, in which the Syrian wrote: “I do not like the words of the poet Rudyard Kipling the ‘Oh, the East is East, and the West is West, and never the twain shall meet’! Instead I promote the union of the East and the West. The East is not east and the West is not west but they meet somewhere. As an example, with rational thought, two great souls from here and from there can agree with each other irrespective of the vast separation in time and space.”

“This is some of the material considered so inflammatory she remains incarcerated,” said Rowling. “I repeat that beautiful plea for plurality, tolerance and the importance of rational discourse in the hope that Tal Al-Mallouhi will soon be freed. In the meantime, long may Pen continue to fight for her, and for the freedoms on which a liberal society rests, without which no literature can have value.”