Updated

Ben Affleck and Jennifer Garner have settled their lengthy divorce proceedings while Affleck is checked into rehab for alcohol addiction.

The couple, who split in 2015 after 10 years of marriage followed by three years of separation, will finalize their divorce after the actor completes his treatment, according to TMZ.

The site also reports that the couple did not have a prenup and have reached a property settlement. Additionally, they have agreed to joint custody of their three children — Violet, 12, Seraphina, 9, and Samuel, 6.

The agreement — after the LA County Superior Court warned that their case may be dismissed — comes as Affleck checked himself into rehab following his split with longtime girlfriend Lindsay Shookus and fling with Playboy model Shauna Sexton.

Paparazzi captured Garner, who has not been romantically linked to anyone since their divorce, driving her ex to rehab and stopping for fast food on the way to The Canyon at Peace Park in Malibu, Calif.

Affleck previously checked into rehab for treatment in 2001 and again in 2017.

Reps for the couple did not immediately respond to requests for comment.

This story originally appeared in the New York Post.