It was a standing ovation to remember, for a player who will never be forgotten.

CC Sabathia started his 306th game in a Yankees uniform Wednesday night against the Angels, and you could hear the generations of appreciation roaring throughout Yankee Stadium as the 39-year-old was removed from the mound in the last regular-season home start of his 18-year career.

“It was good, it was fun to be able to be out there,” Sabathia said after the 3-2 loss on a day in which the Yankees were unable to clinch after their defeat was followed by a Rays’ 8-7 win over the Dodgers. “Especially with a chance to clinch, that’s all I was really thinking about. Just trying to make good pitches and when the team is in the position that it’s in, it kind of takes the focus off of you.”

But the six-time All-Star, who in February announced his plan to retire at the end of this season, probably would have drawn up his last appearance before the postseason a little differently as he vies for a spot on the playoff roster.

Sabathia pitched 2 ²/₃ innings, finishing with two earned runs on five hits and four strikeouts before he was replaced by Domingo German for the second straight outing.

To start the game, Sabathia gave up a bunt single to David Fletcher, failing on a diving attempt to make a play on the ball. But the left-hander managed to retire the next two batters before giving up a single and then a groundout to end the first.

He made quick work of the Angels in the second, striking out the side in order on just 15 pitches.

But things started to go south in the third following a leadoff strikeout, when the Angels put runners on first and second from a Fletcher single and an Andrelton Simmons walk. Albert Pujols ripped a hard-hit single to Giancarlo Stanton, and the left fielder threw a bullet to Kyle Higashioka at home, but too late as the Angels took a 1-0 lead.

Sabathia followed with another walk and allowed an RBI single to Kevan Smith before prompting a pop out from Brian Goodwin for his final out of the evening.

Manager Aaron Boone came to the mound and greeted Sabathia with a bear hug before No. 52 tipped his cap to the cheering fans. Dellin Betances, sporting a boot on his left foot after partially tearing his Achilles tendon in Toronto on Sunday, led the line of players waiting to embrace Sabathia.

“Very [emotional], the amount of respect I have for him,” said Boone, who was teammates with Sabathia on the Indians from 2005-06. “He’s such a good competitor. Basically [I said], ‘Way to go, I love ya.’ Not much else to say. To see him get the ovation that he did, and get big out there in a big spot, too, with the bases loaded. It was a big time in the game, too, it was emotional walking out there.”

Cameras caught Sabathia’s family members, including wife Amber and mother Margie, with tears in their eyes as they applauded from the stands.

With the playoffs steadily approaching, Sabathia said he’s “game for whatever” role the Yankees need him to play, including coming out of the bullpen.

Sabathia has pitched 1,917 innings for the Yankees throughout his 11 years with the organization, becoming a World Series champion (2009) in the process. He has amassed 251 wins and 3,091 strikeouts during his career, which included eight years with the Indians and a brief stint with the Brewers, and likely has paved his way to a spot in Cooperstown.

“That was amazing, nothing like The Bronx and New York City and putting the pinstripes on,” Sabathia said. “Got a chance to do that for 11 years, definitely a blessing.”