Matthew Perry is heading home after spending three months in the hospital following gastrointestinal surgery
Credit: Michael Kovac/FilmMagic

Matthew Perry is heading home after spending the last three months in the hospital following gastrointestinal surgery.

“He’s good,” a source tells PEOPLE, adding that the actor is “going home finally.”

The update comes just hours after the 49-year-old Friends star tweeted about his lengthy hospital stay.

“Three months in a hospital bed. Check,” he wrote on Friday, penning his first tweet in nearly six months.

In August, it was first revealed that the actor was on the mend after undergoing surgery. “Matthew Perry recently underwent surgery in a Los Angeles hospital to repair a gastrointestinal perforation,” a rep for the actor said in a statement to PEOPLE.

“He is grateful for the concern and asks for continued privacy as he heels,” the statement concluded.

A gastrointestinal perforation “occurs when a hole forms all the way through the stomach, large bowel, or small intestine. It can be due to a number of different diseases, including appendicitis and diverticulitis. It can also be the result of trauma, such as a knife wound or gunshot wound,” according to A three-month bedridden recovery is normal given Perry’s condition.

RELATED VIDEO: Matthew Perry Says He ‘Can’t Remember’ 3 Years of Filming ‘Friends’ Because of Substance Abuse

Throughout his career, Perry has been candid about his health battles, including his struggles with alcohol and Vicodin addiction.

“I couldn’t stop,” Perry told PEOPLE in 2013. “Eventually things got so bad that I couldn’t hide it, and then everybody knew.”

53rd Annual Golden Globe Awards
Matthew Perry with Lisa Kudrow, Jennifer Aniston and Courteney Cox
| Credit: Ron Galella/WireImage

Perry has also become a voice for people struggling with addiction. “You can’t have a drug problem for 30 years and then expect to have it be solved in 28 days,” Perry told The Hollywood Reporter in a video for Phoenix House, a California-based treatment center where Perry has gotten treatment.

“At Phoenix House, I was very moved by the hope that I saw there, which is what this is all about,” Perry said, adding that “getting sober is a really hard thing to do.”

In honor of his road to recovery, Perry was presented with the 2015 Phoenix Rising Award.

“I’m an award-winning alcoholic,” Perry continued. “I shouldn’t be getting an award; Phoenix House should be getting an award.”

If you or someone you know is in need of help, please contact the SAMHSA substance abuse helpline at 1-800-662-HELP.