Struggling Yankee pitcher CC Sabathia announced on Monday that he will spend the postseason drying out in rehab while his teammates chase a World Series title — a move that follows a weekend-long bender during a Baltimore road trip, sources told The Post.

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

The last straw for Sabathia came during the team’s final regular-season series in Baltimore, where he spent most of his time pounding drinks at a hotel, the source said.

Sabathia, 35, arrived there with his teammates late Thursday after his home victory against the Red Sox clinched a playoff spot for the Yankees.

By Friday, the pitcher looked “out of it” as the team waited around Baltimore’s Camden Yards to play a game that was eventually rained out.

“He drank every day last week apart from the day he pitched,” the source said. “The tipping point was Friday when he was at the stadium. He carried on drinking Saturday.”

The team had been staying at the Four Seasons hotel during their Baltimore series. A bartender there told The Post he didn’t personally see CC, but said, “We have a strict policy. Whenever sports teams or big names come in, we give them whatever they need, no questions.

“We have 24-hour room service here,” he added. “Whatever happens in their private room is out of our control.”

Sabathia, a father of four, made the announcement the day before the Bombers’ do-or-die wild-card game Tuesday against the Houston Astros at Yankee Stadium.

“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,” the lefty hurler 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, I want to be a better man, father and player.”

He later put the statement on Facebook with a meme of a dog cleaning up its own poop that read: “Just trying to get my s- -t together.”

Sabathia left for a Connecticut rehab facility on Sunday — and will spend at least 30 days in treatment, forcing him to miss the entire postseason, sources said.

While he’s not regarded as a big drinker, Sabathia was the team’s celebratory booze wrangler.

He arranged for magnums of champagne for the playoff-clinching clubhouse party on Thursday, and also ordered the bubbly for Alex Rodriguez’s 3,000th hit, sources said.

Yankee manager Joe Girardi said Sabathia shared his decision with him on Sunday in Baltimore.

“The first thing he said is, ‘I need help,’ ” Girardi said. “I was shocked.”

Yankee general manager Brian Cashman also received the news on Sunday, during a conference call.

[mlbvideo id=”519844383″ width=”640″ height=”360″ /]

“I was unaware of the situation we are now dealing with,” he said, adding that he was “surprised” to field that call.

“But in most cases, you are. A lot of this stuff occurs behind the scenes and away from the professional world.”

He praised the six-time All Star for coming forward with his alcohol problem and “trying to tackle it head-on.”

“What CC is dealing with is a life issue,” Cashman said. “It is bigger than the game [Tuesday] night.”

Cashman wouldn’t say how long Sabathia has been struggling with alcoholism, but Sabathia has found himself in a few troubling situations in the past year.

In December 2014, he became irate when his group was told they couldn’t board a flight from Newark Airport to Jamaica because they had showed up too late. Cops were called to calm him down, and they eventually took a later flight.

In August, the pitcher got into a confrontation outside a Toronto nightclub when hecklers taunted him in the wee hours of the morning. A friend forced Sabathia into a car, but not before he was caught on camera yelling and pointing in a video posted online by TMZ.

And recently, he angered team officials by failing to show up to a sponsored event with the team after a game at Yankee Stadium, sources said.

Sabathia led the Yankees to a World Series title in 2009, his first season in New York after signing a seven-year, $161 million contract.

But in recent years, the pitching ace, whose weight was regularly in the 300-pound range, began showing a marked decline. Last year, his season was cut short because of a knee injury that required surgery. This year, he finished 6-10 with a 4.73 ERA.

The 2007 AL Cy Young Award winner is still scheduled to rake in $25 million next season and has a $25 million vesting option for 2017.

Sabathia ended his statement by saying he anticipates playing in 2016.

“I am looking forward to being out on the field with my team next season, playing the game that brings me so much happiness,” he said.

Additional reporting by Marisa Schultz and Howie Kussoy