SANTA CLARA, Calif. (AP) — A dominant defense and Deebo Samuel.

The formula that has been so successful for the San Francisco 49ers against the Los Angeles Rams delivered another convincing win.

Samuel turned a short catch into an electric 57-yard touchdown, Talanoa Hufanga returned an interception for a score and the 49ers beat the Rams 24-9 Monday night.

“We knew it would be an ice-bag game,” Hufanga said. “Every time we play these guys it’s a physical matchup. For us as a defense, we want to be the rock. We want to be solid on defense, stand our ground and go out there and swarm.”

Jeff Wilson Jr. also scored on a 32-yard run that gave the Niners (2-2) their seventh straight regular-season win over their in-state rivals.

The Rams (2-2) won the matchup that meant most in last season’s NFC championship game on the way to a Super Bowl title, but this meeting looked more like their recent regular-season meetings.

San Francisco used a relentless defense to slow down coach Sean McVay’s offense and got enough big plays for the win.

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 story of the night from an offensive perceptive was self-inflicted wounds,” McVay said. “Just above the neck errors where we’re not doing the things that we are capable of and I expect us to be better than that.”

Samuel once again delivered the big blows offensively. The key play came late in the second quarter when he turned what looked to be an interception by Jimmy Garoppolo into a touchdown.

Derion Kendrick jumped the 5-yard route and nearly got the pick. But Samuel made the catch and that’s when his work really started.

He broke tackles from Taylor Rapp and Jalen Ramsey and weaved his way through the Rams defense for the final 52 yards to give the Niners a 14-6 lead.

“It was just me and the ball out there,” Samuel said. “I just go out and break some tackles like I do all the time.”

Samuel has scored seven TDs and thrown another touchdown in eight career games against Los Angeles.

“He does that time and time again,” tackle Mike McGlinchey said. “There’s a reason he’s one of our best players. He delivers for us in our biggest moments at all times, and especially against that damn team.”

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.

Los Angeles struggled to move the ball consistently after that and the Rams couldn’t finish drives when they did. They were held to field goals on three trips into the red zone.

San Francisco struck back with big plays that led to two long touchdowns. Wilson took advantage of string blocking on a 32-yard burst up the middle on the opening drive for the 49ers that made it 7-3.

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 on a screen that Hufanga anticipated perfectly.

“You can smell a rat when it comes to those things,” he said. “They’ve been running screens all night. I saw a different release than I’m used to. Instead of following man, I turned my head and the ball dropped to me.”

BIG HIT

One of the biggest hits of the game was delivered to a protestor who ran out on the field late in the second quarter with a device letting out pink smoke.

As the protestor got close to the Rams sidelined, linebacker Bobby Wagner came off and flattened him with a big hit. The man was taken off the field by security and the game quickly resumed.

“I just saw someone running on the field,” Wagner said. “It looked like he wasn’t supposed to be on the field so I saw security was having a problem so I helped them out.”

INJURIES

Rams: Coleman Shelton, filling in for injured center Brian Allen, left the game with an ankle injury in the first quarter. That forced third-string center Jeremiah Kolone into action.

49ers: Colton McKivitz, filling in for injured All-Pro LT Trent Williams, left the game in the second half with a knee injury and didn’t return. … DT Arik Armstead, who missed last week’s game with a foot injury, left this game as well with an injured foot and didn’t return.

UP NEXT

Rams: Host Dallas on Sunday.

49ers: Visit Carolina on Sunday.

___

More AP NFL coverage: https://apnews.com/hub/nfl and https://twitter.com/AP_NFL