Ben and Jen met Garner's home Thursday for several hours to hammer out the remaining details in their divorce. After reaching a final agreement ... both signed on the dotted line to officially end things.
In order for the divorce to be finalized and make the pair legally single, they'll still need approval to use a private judge who will then need to submit the docs to the court for the papers to get stamped. We're told that will happen by the end of this year.
As we first reported ... Ben and Jen's final settlement was to be agreed on once Ben got out of rehab. With him now out of rehab, that plan was set into motion.
TMZ broke the story ... Ben's drinking was a sticking point in the settlement. Before rehab, Ben had fallen off the wagon for 18 months. It was an issue because when Ben isn't sober ... it puts Ben and Jen's 3 kids at risk when he's with them.
We broke the story ... Jen filed for divorce back in April 2017 and it was as amicable as it can get. They reached a property settlement, which was complicated and time-consuming because of the fortune that needed to be divided. They did NOT have a prenup, so all of their earnings during their 12-year marriage went into one pot.
As for custody ... Ben and Jen agreed to joint custody, though the settlement does not say how much custodial time Ben and Jen each get. They've gotten along great coparenting the kids ... and felt shifting custody based on their work schedules rather than abide by a rigid formula served them better.