The San Francisco 49ers just lost the star they hoped would help raise their fortunes. Quarterback Jimmy Garoppolo will need season-ending surgery on his injured left knee.

The 49ers said Monday that an MRI confirmed the team’s fears that Garoppolo tore his ACL while making a cut late in a loss at Kansas City.

With five minutes remaining against the Chiefs, the 49ers were trailing 38-24 when Garoppolo led them on a near-scoring drive in the final minutes, as Fox News previously reported.

The Chiefs’ defense responded by sacking Garoppolo on consecutive plays before flushing him from the pocket on the third-and-goal from the 20-yard line. That’s when the San Francisco quarterback headed for the sideline.

Garoppolo’s left knee buckled just before the Chiefs’ cornerback delivered a shoulder-to-shoulder blow, sending Garoppolo down. Garoppolo was on the turf for a couple of minutes before he was helped to his feet and eventually carted off late in a 38-27 loss to Kansas City.

The injury deals a serious blow to the 49ers (1-2), who had planned their rebuild around Garoppolo.

Garoppolo’s ousting is the 49ers second loss after top running back Jerick McKinnon, who endured a season-ending knee injury last month.

The team now has only two other quarterbacks on the roster.

San Francisco must go through the season with C.J. Beathard at quarterback. The Niners struggled with Beathard last season before the midseason addition of Garoppolo changed their fortunes.

San Francisco won the final five games last year after Garoppolo took over as starter and the team rewarded him with a $137.5 million, five-year contract.

The Associated Press contributed to this report.