TheImageDirect.comCC Sabathia has completed a nearly month-long stay at a Connecticut alcohol rehabilitation facility and left Friday, according to a person with knowledge of the situation.

Sabathia was photographed Monday for the first time since announcing Oct. 5 he would enter rehab, emerging from a salon in his hometown of Alpine, NJ, with his wife, Amber.

On the eve of the Yankees’ eventual wild-card loss to the Astros, the left-hander shocked the team and its fans, telling them he needed help.

“I love baseball and I love my teammates like brothers, and I am also fully aware that I am leaving at a time when we should all be coming together for one last push toward the World Series,” Sabathia said in a statement. “It hurts me deeply to do this now, but I owe it to myself and to my family to get myself right. I want to take control of my disease, and I want to be a better man, father and player.”

Sabathia pitched Oct. 1 when the Yankees clinched the wild-card spot at Yankee Stadium against the Red Sox. The team celebrated with champagne before flying to Baltimore. Sabathia was with the team Friday and Saturday and left for the rehab facility before that Sunday’s game (Oct. 4).

“His drinking got really bad this weekend, and it put him in a really bad place,” said a source close to the team. “He was afraid. He felt that if I don’t do this now and go into rehab, I don’t know what is going to happen.”

Had the Yankees beaten the Astros, Sabathia would have been on the roster for the ALDS against the Royals. He would have been used out of the bullpen for the opening round and moved into the rotation had the Yankees advanced.

In 29 starts, Sabathia went 6-10 with a 4.73 ERA, but he pitched better in his final four starts.

Sabathia will earn $25 million in 2016, and there is a vesting option for $25 million ($5 million buyout) for 2017. The option vests if Sabathia doesn’t end 2016 on the DL due to a left shoulder problem, doesn’t spend more than 45 days on the DL in 2016 due to a left shoulder injury and does not make more than six relief appearances in 2016 because of a left shoulder problem.