Johnny Depp will no longer portray the dark wizard Gellert Grindelwald in the “Fantastic Beasts” film franchise, the actor announced Friday.

“I wish to let you know that I have been asked to resign by Warner Bros. from my role as Grindelwald in ‘Fantastic Beasts’ and I have respected and agreed to that request,” he wrote Friday on Instagram.

Depp’s exit from the “Harry Potter” spinoff series comes days after he lost his libel case against The Sun, a British tabloid that published an article in 2018 alleging he was a “wife beater.” Depp said he plans to appeal the ruling.

Warner Bros. confirmed Depp’s departure and announced his role will be recast before the third installment opens in theaters. The studio also pushed back the release date for the upcoming entry, which was originally set for November 2021. It will now premiere in the summer of 2022.

“Johnny Depp will depart the ‘Fantastic Beasts’ franchise. We thank Johnny for his work on the films to date,” a Warner Bros. spokesperson said. “‘Fantastic Beasts 3’ is currently in production, and the role of Gellert Grindelwald will be recast. The film will debut in theaters worldwide in the summer of 2022.”

The prequel series, set decades before the adventures of everyone’s favorite bespectacled boy wizard, is intended to be a five-film franchise. Depp, who briefly appeared at end of 2016’s “Fantastic Beasts and Where to Find Them,” returned in a more prominent role for 2018’s “Fantastic Beasts: The Crimes of Grindelwald.” Depp’s casting has been controversial from the start due to domestic violence allegations that his ex-wife Amber Heard leveled against the star. Despite public outcry from fans, author J.K. Rowling and Warner Bros. vehemently defended the decision to stick with Depp at the time.

“Fantastic Beasts and Where to Find Them” was commercial successful, generating more than $800 million at the global box office. Yet the series appears to already be experiencing diminishing returns. The sequel grossed $654 million worldwide, the lowest ticket sales for a movie based on Rowling’s wizard lore.

In Friday’s statement, Depp thanked fans for their “support and loyalty.” “I have been humbled and moved by your many messages of love and concern, particularly over the last few days,” he said.

“The surreal judgement of the court in the U.K. will not change my fight to tell the truth and I confirm that I plan to appeal,” he concluded. “My resolve remains strong and I intend to prove that the allegations against me are false. My life and career will not be defined by this moment in time.”