Jeff Wilson Jr. also scored on a 32-yard run that gave the Niners their seventh straight regular-season win over their in-state rivals.
Nick Bosa had two of San Francisco's seven sacks against Matthew Stafford to give him an NFL-best six on the season and Hufanga iced it with his 52-yard pick-6 in the fourth quarter. It was San Francisco's fourth pick-6 against the Rams in their last six regular-season meetings. The Rams moved the ball efficiently down the field on the opening drive before a sack by Samson Ebukam stalled the drive and forced Los Angeles into a field goal.
Samuel added the second touchdown and Robbie Gould kicked a 25-yard field goal after a Niners drive stalled at the 1. Gould missed a 42-yarder midway through the fourth quarter to keep the Rams in the game until Stafford's interception.BIG HIT