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.
Film studio Warner Bros confirmed Depp's departure and said his role would be recast.
"We thank Johnny for his work on the films to date," it said in a statement.
Depp, 57, had sued the publisher of The Sun newspaper 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 the article to be "substantially true".
n light of recent events, I would like to make the following short statement.
Firstly 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.
Secondly, 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 that and agreed to that request.
Finally I wish to say this, The surreal judgement of the court in the UK will not change my fight to tell the truth and I confirm that I plan to appeal.
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.
Thank you for reading. Sincerely, Johnny Depp
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, which were based on the novels by JK Rowling.
According to Warner Bros, the third film in the series is currently in production and will be released in summer 2022.