JK Rowling said one of the characters in her new crime novel, a male killer who on one occasion disguises himself as a woman to abduct a victim, was loosely based on two real-life murderers.
In a vitriolic online debate, pro- and anti-Rowling hashtags trended on Twitter after the novel's publication on Tuesday, because an early review in the Telegraph newspaper said the book's moral seemed to be "never trust a man in a dress".
Critics of the Harry Potter author accused her of revealing prejudice through a transphobic trope, while supporters defended her right to write fiction without people jumping to conclusions about her beliefs or abusing her.
Rowling has long faced accusations of transphobia, which she rejects, because of some of her tweets. In an essay in June, she defended her right to speak about trans and gender issues without fear of abuse and detailed her concerns about the impact of some trans activism on women's rights.
The 900-page book Troubled Blood is the fifth in the Cormoran Strike series Rowling has published under the name Robert Galbraith.
Writing on her Galbraith website, Rowling described the character as "a sadistic serial killer active in the 60s and 70s, who was loosely based on real-life killers Jerry Brudos and Russell Williams - both master manipulators who took trophies from their victims".
Brudos and Williams both fetishised and stole items of women's clothing before they were jailed, in the United States and Canada respectively, for multiple murders.
The publishers said 100,000 copies of Troubled Blood were sold in the UK market on the first day, including hardback copies, e-books and audio books.