Harry Potter author JK Rowling on Thursday defended the decision to cast Johnny Depp in the next Fantastic Beasts movie, after a backlash from fans unhappy about the circumstances of the actor’s recent divorce.

In a statement on her personal website, Rowling said filmmakers had considered recasting the role of villain Gellert Grindelwald for Fantastic Beasts: The Crimes of Grindelwald, the sequel to 2016’s Fantastic Beasts and Where to Find Them.

But she said the circumstances of Depp’s divorce from actor Amber Heard last year were private and should be respected.

The Warner Bros movie, due to be released in November 2018, is the second of a planned five movie spinoff franchise from the blockbuster Harry Potter films.

“Harry Potter fans had legitimate questions and concerns about our choice to continue with Johnny Depp in the role,” Rowling wrote.

“The agreements that have been put in place to protect the privacy of two people, both of whom have expressed a desire to get on with their lives, must be respected.

“The filmmakers and I are not only comfortable sticking with our original casting, but genuinely happy to have Johnny playing a major character in the movies,” Rowling said.

Depp’s marriage to Heard ended in divorce amid Heard’s allegations of domestic abuse.

After reaching a private settlement in August 2016, the couple issued a joint statement saying their relationship was “intensely passionate and at times volatile but always bound by love,” and that there was “never any intent of physical or emotional harm”.

It really isn’t too late to replace Johnny Depp, guys. https://t.co/yE7ltZLI9L — kateyrich (@kateyrich) November 16, 2017

Warner Bros said in a statement on Thursday that it supported the decision to keep Depp. Director David Yates and producer David Heyman also said in a joint statement that while recognising “the magnitude of the issues raised” they stood by the decision to cast Depp.

Yates also defended the casting of Depp last month, saying he was “full of decency and kindness” in an interview with Entertainment Weekly.

“There’s an issue at the moment where there’s a lot of people being accused of things, they’re being accused by multiple victims, and it’s compelling and frightening,” he said. “With Johnny, it seems to me there was one person who took a pop at him and claimed something ... Whatever accusation was out there doesn’t tally with the kind of human being I’ve been working with.”

Depp’s representatives did not immediately respond to a request for comment on Thursday.