SANTA CLARA — Here is how the 49ers (12-3) graded in Saturday night’s 34-31 victory over the Los Angeles Rams (8-7):

PASS OFFENSE: B

Jimmy Garoppolo overcame six sacks after halftime to produce a remarkable walk-off win. Converting a pair of third-and-16 situations won it for the 49ers, with Garoppolo first finding Kendrick Bourne for an 18-yard completion and then getting just enough time to launch a 46-yard bomb to Emmanuel Sanders, setting up Robbie Gould’s game-ending field goal. The pass protection was spotty, as expected with the Rams’ elite rushers and the 49ers’ raw replacements at center (Ben Garland) and right guard (Daniel Brunskill). Neither those sacks nor two interceptions could ruin the 49ers’ march. Tight ends George Kittle (five catches, 79 yards, 1 TD) and Ross Dwelley (25-yard catch) came up big in the fourth quarter. Sadly, one of the rallying cries was to win it for third-string quarterback C.J. Beathard, whose brother Clayton was fatally stabbed outside a Nashville bar the previous night.

RUN OFFENSE: C

Averaging 5.2 yards per carry is impressive, or is it? The best runs were long ones and they produced touchdowns, by Deebo Samuel (19 yards) and Raheem Mostert (16 yards). Tevin Coleman got the first carry, a 2-yard gain en route to five total carries for 33 yards. Matt Breida had no carries, nor is he believed to be injured. With Mike Person’s neck injury keeping him out for the first time after 30 straight starts, Brunskill got pressed into duty, and he walled off Aaron Donald to help key Mostert’s touchdown run.

PASS DEFENSE: C-

The 49ers did not sack Jared Goff, who used play-action and bootlegs to mostly elude Nick Bosa, Arik Armstead and DeForest Buckner. Ahkello Witherspoon surrendered both Rams’ touchdown catches and he’ll continue to draw more attention from quarterbacks who’d rather not test Richard Sherman. Linebacker Fred Warner’s 46-yard interception return for a touchdown was the defensive play of the game — and his two-year career — as it put the 49ers ahead 24-21 at halftime.


SEASON PASS DIGITAL OFFER

If you have not already, we strongly encourage you to sign up for a digital subscription, which gives you access to all content on the Mercury News and East Bay Times websites. With your support, we can continue bringing these stories — and much more — to your screens. Here’s where to sign up for the season pass: Mercury News, East Bay Times.


RUN DEFENSE: B

Warner’s outstanding night also included 11 tackles while fellow linebacker Dre Greenlaw had a team-high 13 tackles (mostly in coverage, mostly against tight end Tyler Higbee). Todd Gurley’s two touchdown runs put the 49ers in a 21-10 hole but he managed only 48 yards on 15 carries (3.2-yard average) and none longer than 8 yards. Overall, the Rams gained just 72 total yards and averaged 3 yards per carry, and that should bode well for the 49ers’ confidence heading into Seattle to face Chris Carson.

SPECIAL TEAMS: A-

A field goal by Robbie Gould won it as time expired, as was the case in the 49ers’ last win, Dec. 8 at New Orleans. Richie James’ 81-yard kickoff return was the answer the 49ers needed after the Rams’ opening touchdown drive. Mitch Wishnowsky pinned 4 of 5 punts inside the 20, including one that got muffed inside the 10.

COACHING: B+

A 12th win sends the 49ers into Seattle with the No. 1 seed within reach, and it will take a better all-around effort than this one to win in Seattle for the first time since Christmas Eve 2011. With injuries continuing to hinder the 49ers in the trenches, the coaches are really getting a workout compensating and adjusting their lineups. The biggest takeaway from this is how Kyle Shanahan and everyone negotiated the Beathard-family tragedy. And “family” is a word players are using more and more to describe this special season.