Updated

Johnny Depp has reached a settlement in a legal battle with his former managers just before a trial was set to begin next month, Fox News has learned.

The terms of the settlement agreement are confidential.

“Johnny Depp is pleased to have achieved a settlement agreement with The Management Group following the legal action he took against the company in January 2017," a rep for the Hollywood actor told Fox News on Monday.

“The lawsuit taken out against The Management Group – and the subsequent settlement — is a further demonstration that Johnny is determined to take firm action to protect his personal and artistic reputation in the interests of his family and his career.

“Following the settlement, Johnny is pleased to be able to revert his full attention to his ongoing artistic endeavors, notably the second leg of the sold-out Hollywood Vampires global tour and the exciting launch of JK Rowling’s 'Fantastic Beasts: The Crimes of Grindelwald,' which will be released in theaters in November this year.

“Johnny extends his most sincere thanks and appreciation to the true supporters that have shown their loyalty to both him and his family over recent years.”

The 55-year-old sued The Management Group in January 2017, accusing the company of fraud, theft and malfeasance in its mismanagement of his business and financial interests. At the time, Depp was reportedly seeking $25 million in damages.

But The Management Group, led by Joel and Robert Mandel, filed a countersuit, alleging the star was the one who was recklessly spending his own money on extravagances, including $30,000 a month just for wine, as well as a sound engineer who was allegedly hired to feed him lines while filming, so he wouldn’t have to memorize them.

The lawsuit also alleged Depp spent $3 million to have the ashes of his friend, journalist Hunter S. Thompson, blasted out from a cannon in Aspen, Colo., following his death in 2005.

The trial was initially scheduled for August 15. However, Variety noted the two sides had a successful mediation over the weekend with Peter Lichtman, a retired judge who served as an arbitrator.

The publication added Depp still has a pending suit against his former attorney Jake Bloom, whom he accused of malpractice.

Back in June, Rolling Stone pointed out that Depp has made $650 million on films that netted $3.6 billion but “almost all of it is gone.”

Depp told the magazine he doesn’t deny having the sound engineer on his payroll, but only so that he can play him specific sounds, allowing the actor to convey emotions with his eyes while shooting.

“I’ve got bagpipes, a baby crying and bombs going off,” explained Depp. “It creates a truth. Some of my biggest heroes were in silent film… It had to be behind the eyes. And my feeling is, that if there’s no truth behind the eyes, doesn’t matter what the f------ words are.”

Depp also said he splurged on wine and that the reported figures are actually way less.

“It’s insulting to say I spent $30,000 on wine,” he scoffed. “Because it was far more.”

Depp, who played Thompson in the 1998 film “Fear and Loathing in Las Vegas,” also said the reported figure for the cannon blast is low.

“By the way, it was not $3 million to shoot Hunter into the f------ sky,” he said. “It was $5 million.”

Depp did reveal he worried how his financial woes would impact his children, 19-year-old Lily-Rose and 16-year-old Jack.

“My son had to hear about how his old man lost all his money from kids at school, that’s not right,” said an emotional Depp.

Unable to “take the pain,” Depp immersed himself in music and went on tour with his band, the Hollywood Vampires. He also found inspiration from his friend Thompson and began writing his memoirs on an old typewriter.

“I poured myself a vodka in the morning and started writing until the tears filled my eyes and I couldn’t see the pages anymore,” he said. “I kept trying to figure out what I’d done to deserve this. I tried being kind to everyone, helping everyone, being truthful to everyone… The truth is most important to me. And all of this still happened."