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.