Ben AffleckandJennifer Garnerare officially divorced three years after separating.

Affleck and Garner, both 46, agreed to joint legal and physical custody of their three children:Violet, 12,Seraphina, 9, andSamuel, 6.

According to their settlement, the two stars also agreed to meet with a co-parenting therapist on a monthly basis for a minimum of six months.

They will also each pay for their own attorney’s fees.

The estranged couple announced their separation in June 2015 after 10 years of marriage and three children together. Affleck and Garner began dating in 2004 and married in June 2005 before simultaneously filing for divorce in April 2017.

Jason Merritt/Getty

85th Annual Academy Awards - Arrivals

In October, the news of their divorce came a day after Affleckaddressed his recent rehab stay, where he was treated for 40 days.Affleckentered rehab on Aug. 22to address his alcohol addiction, PEOPLE previously confirmed. Garner was seen driving him to the treatment center.

“The support I have received from my family, colleagues and fans means more to me than I can say. It’s given me the strength and support to speak about my illness with others,” Affleck wrote in the statement, posted to his Instagram. “Battling any addiction is a lifelong and difficult struggle. Because of that, one is never really in or out of treatment. It is full-time commitment. I am fighting for myself and my family.”

Garner and Affleck have continued to spend time as a family and co-parent after they officially filed for divorce almost two years after announcing their separation in 2015. They recentlytook the kids to seeHello, Dolly!on Broadwayin mid-July, starring family friend Victor Garber, and spent Easter together in Hawaii where Affleck was filming.

RELATED VIDEO: A Family Affair!Jennifer GarnerAttends Walk of Fame Ceremony Alongside Her Three Kids

David Fisher/Rex USA

EE British Academy Film Awards, Winners, Royal Opera House, London, Britain - 10th February 2013

Garner recently opened up about how theintense tabloid scrutinythe couple faced during their marriage took a big toll on her. Explaining how for a decade there would be up to five or six cars trying to get the scoop on what was going on between them, Garner said onCBS Sunday Morning, “Looking back on that, I really feel the stress of it.”

“I really — I could cry talking about it,” she continued.

“What I think I’ve learned is that the scrutiny in your private life puts a pressure to make something happen,” she explained. “You feel a pressure to hurry up and get married, ‘cause you think that’ll end the — ‘Are they engaged? Are they not?’ And that’s true in the reverse, as well. If you are — if you know, if there is any inkling of trouble, or if the tabloids decide there’s trouble, it can create trouble.”

source: people.com