ORCHARD PARK, N.Y. -- San Francisco 49ers running back Christian McCaffrey suffered what is believed to be an injury to the posterior cruciate ligament in his right knee Sunday night, leaving the rest of his season in jeopardy, according to coach Kyle Shanahan.

"I think potentially [it's season-ending]," Shanahan said after San Francisco's 35-10 loss to the Buffalo Bills. "I think PCL is usually a couple weeks, but I'm not exactly sure yet."

McCaffrey is slated to undergo further testing Monday that will determine the extent of the injury and whether he can play in any of San Francisco's five remaining games.

For the first quarter-plus against the Bills, McCaffrey looked poised for the breakthrough night he has been seeking since his return from an Achilles injury.

That momentum came to a screeching halt with 11:23 to go in the second quarter when McCaffrey took a pitch to the right. As he planted his feet to turn upfield, he instead opted to slide down without contact.

After the 5-yard loss, McCaffrey jumped up and quickly limped directly to the blue injury tent. After a few minutes in there, he headed to the locker room for further examination.

Initially, McCaffrey was labeled questionable to return with a right knee injury, but he was ruled out at halftime.

McCaffrey's latest injury appeared to happen about 95 seconds before the play where he gave himself up. With 12:58 left in the second quarter, McCaffrey burst up the middle for an 18-yard gain.

But as McCaffrey attempted to avoid the last line of Buffalo's defense, Bills safety Taylor Rapp tripped him by his right ankle, forcing McCaffrey to come down hard on his right knee.

McCaffrey checked out briefly after the play but went back in a couple of plays later for the run to the right that would ultimately end his night.

"It was frustrating," Shanahan said. "He had a great week of practice and I could feel his urgency and stuff and thought he came out great, looking really good, and it looked like he just got his shoestring there. ... I hurt for him, and tough for our team not having him."

At the time of McCaffrey's injury, he had seven carries for 53 yards and two receptions for 14 yards. That included season-best rushes of 19 and 18 yards.

Sunday night was just McCaffrey's fourth game since returning from the bilateral Achilles tendinitis that kept him out for most of training camp and all of San Francisco's first eight games.

McCaffrey had been slowly working back into form over the past three weeks and said this week that he felt a breakout game was close. And for about 18 minutes, McCaffrey's teammates believed it was happening.

"We all saw what he was doing, and he was on fire," quarterback Brock Purdy said. "He looked great. Hitting the holes hard and bouncing off guys and making some real explosive plays, and that's huge. ... He's one of the best running backs in the league and you lose him like that. I think it takes away just sort of how we do some things within the offense. It sucks."

As he did for the first couple months of the season, Jordan Mason capably filled in for McCaffrey while he was out. Mason finished with 13 carries for 78 yards, and rookie backup Isaac Guerendo scored the Niners' lone touchdown of the night, bursting off the left side from 15 yards out.

Still, with the Niners having already lost stalwarts such as receiver Brandon Aiyuk and defensive tackle Javon Hargrave to season-ending ailments and regularly missing stars -- they played without left tackle Trent Williams, end Nick Bosa and cornerback Deommodore Lenoir on Sunday night -- losing McCaffrey felt like just another body blow in a season full of them.

The result is a 5-7 team that is mathematically clinging to postseason hopes but realistically just trying to snap a three-game losing streak that includes consecutive losses with at least 25-point deficits.

"It's not a great feeling, but I mean, it's football," tight end George Kittle said. "People go down and we've had seasons where plenty of people have gone down and you need someone to step up and that's what we need. We continually need guys to step up, whether it's starters and players that we have that are already doing it or new guys who are getting into the rotation. We're in the NFL for a reason. All these guys belong in the NFL and they have playmaking abilities. That's on all of us."