Ben Affleck is speaking out for the first time since his recent stint in rehab.

In a message posted to Instagram Thursday, the "Justice League" actor, 46, confirmed he completed a "forty day stay at a treatment for alcohol addiction." He revealed his journey is long from over and he will continue outpatient care.

“Battling any addiction is a lifelong and difficult struggle," he wrote. "Because of that, one is never really in or out of treatment. It is full-time commitment."

Related: Reports: Ben Affleck driven to rehab by estranged wife Jennifer Garner

Affleck thanked his family for sticking by his side and noted they are his motivation to keep "fighting."

“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 said.

He added that the outpouring of sympathy from those facing similar battles helped the actor realize, "I am not alone."

"So many people have reached out on social media and spoken about their own journeys with addiction," he wrote. "To those people, I want to say thank you. Your strength is inspiring and is supporting me in ways I didn’t think was possible."

One day, Affleck said, he hopes to be an example "to others that are struggling."

People magazine and Entertainment Tonight first reported Affleck's estranged wife, actress Jennifer Garner, drove the actor to a rehab facility in late August.

The father of three has struggled with alcohol addiction in the past.

Affleck entered rehab in 2001 for alcohol, a couple months after the debut of his film "Pearl Harbor."

In March 2017, he shared on his Facebook page that he'd "completed treatment for alcohol addiction," explaining it was "something I've dealt with in the past and will continue to confront."

"I want to live life to the fullest and be the best father I can be," Affleck wrote before acknowledging Garner. "I'm lucky to have the love of my family and friends, including my co-parent, Jen, who has supported me and cared for our kids as I've done the work I set out to do. This was the first of many steps being taken towards a positive recovery."

Affleck and Garner announced their plans to divorce in 2015 after 10 years of marriage. They have three children together: Violet, 12, Seraphina, 9, and Samuel, 6.

Just days ago, Garner filed paperwork to have their divorce case sent to a private judge to accelerate the process, according to court documents obtained by US Weekly. E! News confirms a judge signed off on her request Monday.

Contributing: Erin Jensen

Related: Demi Lovato breaks silence on Instagram after leaving hospital; reportedly checks into rehab