SANTA CLARA, Calif. — The new-look Los Angeles Rams scored more than 40 points for the second time in three games this season Thursday night, and as it turned out, they needed almost every one of them to hold off the San Francisco 49ers.
Jared Goff passed for 292 yards and a career-high-tying three touchdowns, and Todd Gurley II scored three TDs in a wild 41-39 win at Levi’s Stadium.
“We haven’t been able to put up points like that since Marshall (Faulk) and them left,” Gurley said. “It was a gritty win, but we’ll take it. It definitely feels good. Just happy for Goff to be able to go out there and sling it, especially after the tough year he had last year.”
The Rams (2-1) ended a three-game head-to-head losing streak to the 49ers (0-3), who remained winless under new coach Kyle Shanahan.
“We definitely didn’t start the game well (on offense),” Shanahan said. “We started pretty slow on defense, too. But we battle to the end.”
San Francisco trailed 41-26 late in the fourth quarter, but two touchdowns cut the deficit.
Running back Carlos Hyde’s 1-yard run pulled the 49ers within 41-39 with 2:13 to go, but the two-point try failed when nose tackle Michael Brockers intercepted Hoyer’s deflected pass intended for wide receiver Trent Taylor.
Gurley rushed for 113 yards and two touchdowns on 28 carries, and caught five passes for 36 yards and a score. Rams wide receiver Sammy Watkins caught six passes for 106 yards and two TDs, while wideout Robert Woods had six catches for 108 yards.
“I think in this game, divisional game, you just keep battling, keep battling, no matter how far you’re up,” Woods said. “You know it’s going to be a good game, they’re going to bounce back and find ways to compete. We just finished it off at the end.”
The Rams never scored more than 37 points in a game last season.
“They did exactly what we thought they were going to do,” 49ers free safety Jimmie Ward said. “They just made more plays.”
Goff, who grew up in Marin Country, north of San Francisco, and starred in college at California, completed 22 of 28 passes with a career-high passer rating of 145.8 in his first career start at Levi’s Stadium.
“Really pleased with Jared tonight,” Rams rookie coach Sean McVay said. “I thought he made great decisions with the football. I thought Jared managed the game extremely well, distributed it to his playmakers, gave guys a chance down the field.”
San Francisco quarterback Brian Hoyer completed 23 of 37 passes for 332 yards and two touchdowns — his first two as a 49er — and ran for a score. He was intercepted once.
Niners wide receiver Pierre Garcon caught seven passes for 142 yards. Hyde rushed for 84 yards and two touchdowns on 25 carries.
The Rams stalled at the San Francisco 1 on their first drive of the second half and settled for Greg Zuerlein’s 19-yard field goal, extending their lead to 27-13 with 9:17 remaining in the third quarter.
San Francisco cut its deficit to 27-20 when Hyde scored on a 1-yard blast on fourth-and-goal later in the third. The Rams answered with Goff’s 1-yard touchdown pass to Sammy Watkins, making it 34-20 entering the fourth quarter.
The 49ers drove 75 yards in six plays for Hoyer’s 1-yard touchdown pass to tight end Garrett Celek with 12:50 left to play. Robbie Gould missed the extra point, leaving Los Angeles with a 34-26 advantage.
“I just rushed it,” Gould said. “I missed it. I made a mistake. Obviously I wish I didn’t do that or we’d probably be playing in overtime right now.”
The Rams extended their lead to 41-26 on Goff’s 13-yard TD pass to Watkins with 8:43 left. Hoyer answered with a 3-yard touchdown pass to Taylor with 5:08 to play, cutting the deficit to 41-33.
On the ensuing kickoff, 49ers wide receiver Victor Bolden Jr. stripped the ball from Rams return man Pharoh Cooper, and San Francisco’s Aldrick Robinson recovered at the Los Angeles 29-yard line.
On fourth-and-goal from the 1, Hyde rammed into the end zone, setting up the failed two-point try.
San Francisco’s Raheem Mostert recovered Gould’s onside kick at the 50 with 2:10 left. However, the 49ers backpedaled, and Rams defensive tackle Aaron Donald sacked Hoyer at San Francisco’s 32 for an 8-yard loss on fourth-and-20.
“We just needed to make a big stop,” Donald said. “We were giving up a lot on defense, we were giving up points.”
Gurley scored all his touchdowns in the first half as the Rams built a 24-13 lead.
Los Angeles took a 7-0 lead only 12 seconds into game, capitalizing on a 49ers turnover on the game’s first play from scrimmage.
Rams cornerback Nickell Robey-Coleman stepped in front of Hoyer’s short pass intended for Marquise Goodwin and returned the pick 25 yards to the 3.
On first down, Gurley blasted up the middle for a touchdown.
“It was extremely important just for me and the team to start fast, get an early lead and get things going,” Robey-Coleman said. “We went out there and did it.”
NOTES: Niners SS Eric Reid (strained knee), who was injured Sunday against Seattle, was inactive, and S Jaquiski Tartt started in his place. Tartt sustained a game-ending concussion in the third quarter. ... Rams CB Kayvon Webster (shoulder) was inactive, and Nickell Robey-Coleman made his second start of the season. ... Rams FS Lamarcus Joyner left the game early in the second quarter with a left hamstring injury. He did not return. ... San Francisco OLB Tank Carradine (ankle) and MLB Brock Coyle (concussion) were injured in the second half and did not return.