NEW YORK, NEW YORK - MARCH 20:  Actor Ben Affleck attends the "Batman V Superman: Dawn Of Justice" New York Premiere at Radio City Music Hall on March 20, 2016 in New York City.  (Photo by Jamie McCarthy/Getty Images)
PHOTO: Jamie McCarthy/Getty Images
NEW YORK, NEW YORK - MARCH 20: Actor Ben Affleck attends the "Batman V Superman: Dawn Of Justice" New York Premiere at Radio City Music Hall on March 20, 2016 in New York City. (Photo by Jamie McCarthy/Getty Images)
Now playing
00:45
Ben Affleck completes addiction treatment (2017)
HOLLYWOOD, CA - JUNE 22:  Carrie Underwood attends the 2018 Radio Disney Music Awards at Loews Hollywood Hotel on June 22, 2018 in Hollywood, California.  (Photo by Rich Fury/Getty Images)
PHOTO: Rich Fury/Getty Images
HOLLYWOOD, CA - JUNE 22: Carrie Underwood attends the 2018 Radio Disney Music Awards at Loews Hollywood Hotel on June 22, 2018 in Hollywood, California. (Photo by Rich Fury/Getty Images)
Now playing
01:43
Carrie Underwood reveals pregnancy struggles
INGLEWOOD, CA - DECEMBER 01:  (EDITORIAL USE ONLY. NO COMMERCIAL USE) Demi Lovato in the press room during 102.7 KIIS FM's Jingle Ball 2017 presented by Capital One at The Forum on December 1, 2017 in Inglewood, California.  (Photo by Alberto E. Rodriguez/Getty Images for iHeartMedia)
PHOTO: Alberto E. Rodriguez/Getty Images
INGLEWOOD, CA - DECEMBER 01: (EDITORIAL USE ONLY. NO COMMERCIAL USE) Demi Lovato in the press room during 102.7 KIIS FM's Jingle Ball 2017 presented by Capital One at The Forum on December 1, 2017 in Inglewood, California. (Photo by Alberto E. Rodriguez/Getty Images for iHeartMedia)
Now playing
00:45
Demi Lovato 911 call: 'No sirens, please'
Gretchen Wilson arrives at the 50th annual CMA Awards at the Bridgestone Arena on Wednesday, Nov. 2, 2016, in Nashville, Tenn. (Photo by Evan Agostini/Invision/AP)
PHOTO: Evan Agostini/Invision/AP
Gretchen Wilson arrives at the 50th annual CMA Awards at the Bridgestone Arena on Wednesday, Nov. 2, 2016, in Nashville, Tenn. (Photo by Evan Agostini/Invision/AP)
Now playing
00:50
Country singer arrested after airport incident
French actor Gerard Depardieu waves as he arrives at the Town Hall  in Brussels for a ceremony as part of the 'Brussels International Film Festival' (Briff) on June 25, 2018. (Photo by THIERRY ROGE / BELGA / AFP) / Belgium OUT
PHOTO: THIERRY ROGE/AFP/AFP/Getty Images
French actor Gerard Depardieu waves as he arrives at the Town Hall in Brussels for a ceremony as part of the 'Brussels International Film Festival' (Briff) on June 25, 2018. (Photo by THIERRY ROGE / BELGA / AFP) / Belgium OUT
Now playing
01:36
Actor Gérard Depardieu accused of rape
HOLLYWOOD, CA - MAY 18:  Actor Johnny Depp attends the premiere of Disney's 'Pirates Of The Caribbean: Dead Men Tell No Tales' at Dolby Theatre on May 18, 2017 in Hollywood, California.  (Photo by Rich Fury/Getty Images)
PHOTO: Rich Fury/Getty Images North America/Getty Images
HOLLYWOOD, CA - MAY 18: Actor Johnny Depp attends the premiere of Disney's 'Pirates Of The Caribbean: Dead Men Tell No Tales' at Dolby Theatre on May 18, 2017 in Hollywood, California. (Photo by Rich Fury/Getty Images)
Now playing
01:16
Johnny Depp's candid Rolling Stone interview
vince vaughn arrest dui orig sc_00000000.jpg
PHOTO: Manhattan Beach Police
vince vaughn arrest dui orig sc_00000000.jpg
Now playing
01:15
Actor Vince Vaughn arrested for DUI
Jada Pinkett Smith suicide orig mg rf_00003425.jpg
PHOTO: Megyn Kelly TODAY
Jada Pinkett Smith suicide orig mg rf_00003425.jpg
Now playing
01:15
Jada Pinkett Smith on having suicidal thoughts
PHOTO: AFP/Getty Images
Now playing
00:53
Country superstar apologizes for Trump comment
HOUSTON, TX - FEBRUARY 04:  Rapper Meek Mill arrives for the Fanatics Super Bowl Party at Ballroom at Bayou Place on February 4, 2017 in Houston, Texas.  (Photo by Robin Marchant/Getty Images for Fanatics)
PHOTO: Robin Marchant/Getty Images
HOUSTON, TX - FEBRUARY 04: Rapper Meek Mill arrives for the Fanatics Super Bowl Party at Ballroom at Bayou Place on February 4, 2017 in Houston, Texas. (Photo by Robin Marchant/Getty Images for Fanatics)
Now playing
02:11
Meek Mill's legal saga
Now playing
00:54
Will Ferrell involved in car accident
PHOTO: Roc Nation
Now playing
01:12
Meek Mill released from prison
NEW YORK, NY - NOVEMBER 14:  Wendy Williams attends the 50th anniversary celebration of Wilhelmina with co-host Patti Hansen on November 14, 2017 in New York City.  (Photo by Ilya S. Savenok/Getty Images for Wilhelmina Models)
PHOTO: Ilya S. Savenok/Getty Images North America/Getty Images for Wilhelmina Mode
NEW YORK, NY - NOVEMBER 14: Wendy Williams attends the 50th anniversary celebration of Wilhelmina with co-host Patti Hansen on November 14, 2017 in New York City. (Photo by Ilya S. Savenok/Getty Images for Wilhelmina Models)
Now playing
00:47
Wendy Williams on hiatus after diagnosis
PHOTO: Julia Louis-Dreyfus/Twitter
Now playing
01:08
Julia Louis-Dreyfus shares post-op photo
Singer Lana Del Rey performs at Terminal 5 on October 23, 2017 in New York City.  (Photo by Mike Coppola/Getty Images)
PHOTO: Mike Coppola/Getty Images
Singer Lana Del Rey performs at Terminal 5 on October 23, 2017 in New York City. (Photo by Mike Coppola/Getty Images)
Now playing
00:43
Man arrested outside Lana Del Rey concert
Lady Gaga arrives for the 60th Grammy Awards on January 28, 2018, in New York.  / AFP PHOTO / ANGELA WEISS        (Photo credit should read ANGELA WEISS/AFP/Getty Images)
PHOTO: ANGELA WEISS/AFP/AFP/Getty Images
Lady Gaga arrives for the 60th Grammy Awards on January 28, 2018, in New York. / AFP PHOTO / ANGELA WEISS (Photo credit should read ANGELA WEISS/AFP/Getty Images)
Now playing
00:54
Lady Gaga cancels final tour dates
(CNN) —  

Ben Affleck posted an Instagram statement Thursday in which he revealed that he recently completed a 40-day stay at a treatment center and continues his outpatient care for alcohol addiction.

“The support I have received from my family, colleagues, and fans means more to me than I can say,” he wrote. “It’s given me the strength and support to speak about my illness with others.”

Affleck, 46, entered rehab back in August. He previously sought treatment in 2001 and 2017.

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

He added: “I am fighting for myself and my family.”

Affleck has three children with actress Jennifer Garner.

Garner and Affleck filed for divorce in 2017, two years after they separated. The two remain friendly, however.

Garner was photographed with Affleck on the same day he recently reported to rehab.

“So many people have reached out on social media and spoken about their own journeys with addiction. To those people, I want to say thank you,” Affleck said. “Your strength is inspiring and is supporting me in ways I didn’t think was possible. It helps to know I am not alone.”

Affleck said he’s “had to remind myself, if you have a problem, getting help is a sign of courage, not weakness or failure.”

The actor, who was set to write and direct a standalone Batman film before leaving his directing role last year, said he hopes that “down the road I can offer an example to others who are struggling.”