Frankel and Hoppy have been embroiled in a bitter dispute over their 4r-year-old daughter, Bryn, since separating in 2012, but the matter has finally been resolved with both parties receiving joint custody, according to Hoppy’s attorney Bernard Clair.

A statement to People magazine reads: “My client is delighted that this custody battle has been resolved; that his co-parenting status has been acknowledged; that the parties’ child will have the benefit of being raised by both parents; and most importantly, that his daughter will no longer be at the mercy of a high-profile courtroom battle.

“Jason wishes Bethenny only the best of luck, and he looks forward to sharing with her all of the joyous occasions, milestones and blessings that will be coming up in his daughter’s future.”

When Frankel took the stand for the first time last week, the former chat show host wept as she recounted her difficult home life after the breakdown of her marriage to Hoppy, and insisted on primary custody of Bryn.

The former star of “The Real Housewives of New York City” married Hoppy in 2010 and their relationship was documented in reality TV series “Bethenny Ever After.”