Updated

Nearly three years after announcing their plans for divorce, Jennifer Garner is sticking by her estranged husband Ben Affleck's side as the troubled star enters rehab for a third time.

The family-focused actress has proven she will be there for her ex despite Affleck having an affair with their children's nanny, his nasty gambling habit and his consistent substance abuse issues.

Garner proved it yet again when she staged an intervention on Wednesday and dropped off her rough-looking ex at a rehab facility.

Despite being put through the ringer by Affleck, Garner's top concern is their three children: Violet, 12, Seraphina, 9, and Samuel, 6.

garner ben rehab x17

Jennifer Garner drives Ben Affleck to rehab. (X17online.com)

"[Garner has] been Ben's rock," a source told Entertainment Tonight. "She is used to putting on a brave face, and handling Ben's addiction...she won't give up on Ben because he is the father of her kids."

Another source emphasized Garner's focus on her family. 

"Her number one concern is the kids," a source told People Friday adding that Garner had hoped to finalize their divorce but "struggles" with questions like, "Is Ben healthy enough to have custody? Can she rely on him to co-parent?"

According to the second source, what Garner "ultimately cares about is his sobriety" and not "who he is dating."

Affleck's most recent relapse comes after the actor and his girlfriend of one year, "Saturday Night Live" producer Lindsay Shookus, ended their relationship.

Lindsay Shookus

"Saturday Night Live" producer Lindsay Shookus, right, dated Ben Affleck for one year. (2018 Gotham)

ET reported that Shookus wanted Affleck to get treatment but he refused and she felt "helpless."

"Lindsay wanted Ben to go to rehab, but had trouble getting him there," a source told ET. "He didn't want to be controlled and ended things with Lindsay."

That's when Affleck quickly moved on with 22-year-old Playboy model Shauna Sexton.

As Garner took her children to church and had them by her side at her star ceremony on the Hollywood Walk of Fame on Monday, Affleck was out galavanting with his new flame around Los Angeles.

jennifer garner kids walk of fame getty 2018

Actress Jennifer Garner pose with children Violet Affleck, Samuel Garner Affleck and Seraphina Rose Elizabeth Affleck during the ceremony honoring Jennifer Garner with a star on the Hollywood Walk Of Fame on August 20, 2018 in Hollywood, California. (Albert L. Ortega/Getty Images)

Affleck and his young galpal were spotted at Malibu's celeb hot spot Nobu and were also snapped on a much more low-key outing at a Jack in the Box drive-thru, grabbing hamburgers and fries in the actor's Range Rover.

Affleck Sexton (X17)

Ben Affleck was seen grabbing fast food with Playboy model Shauna Sexton. (X17online.com)

The Blast also obtained photos of Affleck receiving a delivery of alcohol at his home in the days leading up to his encounter with Garner.

It was after this that Garner stepped in and showed up at Affleck's home with a Bible and a lawyer. The trio then drove to rehab as Sexton enjoyed a day at the beach.

"Ben trusts Jen entirely and followed Jen's instructions," ET reported. "This time he sounded willing and ready on all counts. Friends who saw Ben's rapid decline are breathing a huge sigh of relief. They have high hopes for a recovery."