Jimmy Garoppolo went down after going out of bounds on this play. (Charlie Riedel / Associated Press)

The San Francisco 49ers fear the worst with the knee injury Jimmy Garoppolo suffered late in a 38-27 loss to the Kansas City Chiefs.

Garoppolo will have an MRI exam on the knee Monday, with Coach Kyle Shanahan confirming that the medical staff believes he has torn his anterior cruciate ligament. Backup quarterback C.J. Beathard, who was the 49ers’ starter last season before Garoppolo took over after coming over in a trade from the New England Patriots, said the latter told him to “lead these guys.”

Garoppolo was hurt late in the game as he headed out of bounds with the ball. His knee gave way before he was hit on the play and he left the field on a cart.

“I feel for him,” Shanahan said.

Garoppolo went straight to the cart when he emerged from the sideline tent used to evaluate injuries.

“All indications are that it’s torn,” 49ers General Manager John Lynch said (via Pro Football Talk’s Peter King). “Our [medical] guys say they’ve been wrong before and so they need to do the MRI, obviously.”

Lynch described Garoppolo as “heartbroken. His family’s heartbroken. You can see it in his eyes, in their eyes. It’s tough. Jimmy needs to play, and he wants to play. But Kyle feels strongly about C.J. We all do.”

Garoppolo was trying to rally the Niners and completed 20 of 30 passes for 251 yards and two touchdowns before hurting his knee. The apprentice to Tom Brady for three seasons in New England, Garoppolo was dealt for a second-round raft pick and impressed last season, completing 67.4 percent of his passes with a 96.2 rating, and hopes had been in high in the Bay Area and elsewhere for an even better season this year.

“It’s a downer,” wide receiver Marquise Goodwin said.

“We got support for Jimmy. That’s a hard pill to swallow,” 49ers linebacker Reuben Foster said. “That’s Jimmy G, you know.

“But guess what? We got C.J. [Beathard] up next. And C.J ain’t no roody-poo.”

Read more from The Post:

Steelers reportedly are entertaining offers for Le’Veon Bell

Nothing personal, Lions, but Rob Gronkowski reportedly nixed a trade

A vin­tage Ti­ger Woods looks poised for his first win in over five years

Al­a­bam­a isn’t all that great. (Nick Sa­ban wants us to tell you that.)

College football winners and losers: Stanford leaves Oregon dazed and confused

Old Dominion rocks col­lege foot­ball with an up­set over Vir­ginia Tech