Johnny Depp is vacating his role in the "Fantastic Beasts" films, Fox News can confirm. 

Warner Bros. spokesperson confirmed the news in a statement to Fox News on Friday. Depp's role as the villain Gellert Grindelwald in the "Harry Potter" prequel series will be recast and the movie is expected to be released in 2022. 

“Johnny Depp will depart the ‘Fantastic Beasts’ franchise. We thank Johnny for his work on the films to date,” the studio 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.”

Depp reacted to the news on social media on Friday. 

BRITISH HIGH COURT RULES AGAINST JOHNNY DEPP IN LIBEL SUIT AGAINST THE SUN

“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.

Depp added, “I’d like to thank everybody who has gifted me with 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 concluded, “Finally, I wish to say this. 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 said. “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.”

HOW JOHNNY DEPP JUDGE RULED ON EACH ALLEGED ASSAULT OF AMBER HEARD

The decision comes after the 57-year-old actor lost his high-stakes libel case Monday against The Sun tabloid newspaper for labeling him a “wife beater,” as a British judge said he believed the actor had abused ex-wife Amber Heard to such an extent that she frequently feared for her life.

In court, Depp accused Heard of making up her allegations, while acknowledging wide-ranging drug problems. However, he insisted he is “not a violent person, especially with women,” a characterization that was backed up in statements from former partners Winona Ryder and Vanessa Paradis.

Johnny Depp in character as Gellert Grindelwald. (Kevin Winter/Getty Images)

The judge found that 12 of the 14 instances of domestic violence had occurred and said that was sufficient to rule against Depp.

DEPP'S LAWYERS VOW TO APPEAL 'FLAWED' AND 'BEWILDERING' LIBEL LOSS

Depp and Heard met on the set of 2011 comedy “The Rum Diary” and married in Los Angeles in 2015. They separated the following year and divorced in 2017.

He continues to deny all allegations of abuse. 

The Associated Press contributed to this report.