Mel B and her estranged husband Stephen Belafonte have reached a settlement days before a trial into her domestic violence allegations was due to begin.
The former Spice Girl accused the producer of being violent during their relationship when she filed documents to end their marriage after almost 10 years in March (17) and obtained a restraining order against him.
Their court battle became increasingly messy over the ensuing months and they were due to face off in court on Monday, but both parties appeared in a Los Angeles court on Thursday and revealed they had reached a settlement.
Belafonte's lawyer Grace Jamra told Judge Mark Juhas, "All the issues before you including the domestic violence restraining order and custody of a minor child have been dissolved."
Sean Macias, Mel's lawyer, told the judge: "We all came to an agreement in principle late last night. We are pretty much done in principle."
Outside the courthouse, her family law mediator Shaun Collinson said, "She stood her ground. Amazing job. We replaced the DV (Domestic Violence Restraining Order) with a private settlement agreement and we're moving forward."
Collinson added that the estranged couple were getting close to reaching an agreement over custody of their six-year-old daughter Madison.
Belafonte posted a video on Instagram to celebrate the settlement.
"Today's a beautiful day, I'm just leaving court, you know what I've gotta tell ya, I'm the happiest guy in the world today," he said. "It's about family, family has been restored, you know I want to thank my family lawyers because they are a family and helped me mentally and legally.
"I'm just glad the cloud of suspicion of domestic violence is no longer over my head and I, my God, Angel I love you, Madison I love you, Phoenix I love you, Giselle I love you. I love my children."
The settlement means they can now move forward with their divorce hearings. Belafonte's lawyers said they are still to resolve disputes over property, shared possessions and his access to Angel, Mel B's daughter with Eddie Murphy.
The 42-year-old also obtained a restraining order against former nanny Lorraine Gilles, but that is close to being resolved as well, Gilles' lawyer told the court.