J.K. Rowling says those objecting to a black Hermione in the new Harry Potter play are a "bunch of racists".
Following online criticism of the casting, the author hit back, saying there was always a possibility the character could be black because skin colour was never mentioned in the books.
The role in the latest instalment of the series, a two-part West End play called Harry Potter and the Cursed Child, will be played by Noma Dumezweni, an Olivier Award-winning actress cast by director John Tiffany.
Rowling said she fully supported the casting because Dumezweni was the best actress for the job.
Speaking to the Observer, Rowling said: "With my experience of social media, I thought that idiots were going to idiot. But what can you say?
"That's the way the world is. Noma was chosen because she was the best actress for the job. When John told me he had cast her, I said, 'Oh that's fabulous', because I'd seen her in a workshop and she was fabulous."
Rowling added: "I had a bunch of racists telling me that because Hermione 'turned white' - that is, lost colour from her face after a shock - that she must be a white woman, which I have a great deal of difficulty with.
"But I decided not to get too agitated about it and simply state quite firmly that Hermione can be a black woman with my absolute blessing," she said.
The character was portrayed by Emma Watson in the films, while covers of the books have shown Hermione as white. The play, which picks up where the epilogue of the final book left off, with Potter as a middle-aged civil servant, is based on a story of the same name by Rowling, Tiffany and Jack Thorne, the writer of TV drama This Is England '90.
Discussing the process of returning to write about Potter and the wizarding world, Rowling said: "Just because I've stopped on the page doesn't mean my imagination stopped.
"It's like running a very long race," she said. "You can't just stop dead at the finishing line."
While information about the play's plot has been sparse, Rowling did say: "I think that, as a theatrical experience, as a play, it will be unlike anything people have seen before."
Tickets for the play, the most expensive of which had a face value of 65 ($135) per show, were being listed for sale online for close to 800 for both parts.
Harry Potter and the Cursed Child, Parts One and Two, opens at the Palace Theatre on July 30. Previews begin tomorrow.