Johnny Depp at the Royal Courts of Justice in July

Johnny Depp has left the Fantastic Beasts film franchise, days after losing a libel case over a newspaper article which called him a wife-beater.

In a letter to fans, Depp said he had been “asked to resign” from his role as Gellert Grindelwald and had “respected that and agreed to that request”.

He called the libel judgement “surreal” and confirmed his plans to appeal.

Warner Bros confirmed Depp’s departure and said the role in the third Fantastic Beasts film would be recast.

“We thank Johnny for his work on the films to date,” it said in a statement.

Depp, 57, sued The Sun’s publisher, News Group Newspapers (NGN), over a 2018 article which claimed he assaulted his ex-wife Amber Heard.

Earlier this week Judge Mr Justice Nicol ruled The Sun had proved what was in the article to be “substantially true”.

In his letter, posted on Instagram, Depp said the judgement would not “change my fight to tell the truth”.

“My resolve remains strong and I intend to prove that the allegations against me are false,” he wrote. “My life and career will not be defined by this moment in time.”

Depp made a brief appearance as Grindelwald in 2016’s Fantastic Beasts and Where to Find Them and reprised his role in 2018’s Fantastic Beasts: The Crimes of Grindelwald.

The films are prequels to the eight Harry Potter films based on the novels of JK Rowling.

According to Warner Bros, the third film in the series is in production and will be released in summer 2022.