Johnny Depp has settled a bitter legal dispute with his former business managers, the actor said Monday, a move that allows him to avoid a public and potentially embarrassing trial over how he has lost much of his Hollywood fortune.

Depp and the Management Group, which handled his finances between 1999 and 2016, arrived at a confidential settlement over the weekend, according to a person familiar with the matter. A judge must now approve the settlement to stop a trial scheduled to begin on Aug. 15. Terms of the settlement haven’t been disclosed.