The couple, who split in 2015 after 10 years of marriage followed by three years of separation, will finalise 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.