ST. LOUIS -- Frank Gore followed Mike Iupati's power block, broke into the open field and raced 34 yards for what could be a season-changing touchdown run by the 49ers' all-time rushing leader.
As Gore celebrated by kissing his right biceps in "Kaepernicking" fashion, the 49ers found themselves with a 14-3 lead and on track to end a two-game losing streak.
That touchdown run by Gore -- on fourth-and-1 with 37 seconds before halftime -- highlighted his 153-yard night and the 49ers' 35-11 victory over the St. Louis Rams.
"It was a get-back-on-track game," Gore said. "We lost two in a row, and we knew we can't lose again. We had to just be us: playing smash-mouth football, playing great defense, playing great special teams."
The spotlight indeed deserved to also shine on the 49ers defense, led by fiery linebacker NaVorro Bowman and an unflinching secondary. That overall unit certainly made do without three key players: Aldon Smith (on personal leave), Patrick Willis (groin injury) and Nnamdi Asomugha (right knee sprain).
The 49ers apparently avoided another injury scare -- a big one -- to left tackle Joe Staley, who got hurt with 1:50 remaining.
"He's going to walk that one off," coach Jim Harbaugh said. Staley indeed was walking OK after the game, requiring only an ice pack strapped to his right hamstring.
Rather than fall further off the pace behind Seattle (3-0), the 49ers (2-2) won their first division road game since last October at Arizona, a stretch that included an overtime loss here and two defeats at Seattle.
Thursday's victory also enhanced the 49ers' playoff prospects. Since 1990, only 14 percent of teams that started a season 1-3 made it to the playoffs. The 49ers gladly joined the ranks of 2-2, where 36 percent of such teams have advanced to the postseason.
After being outscored 56-10 combined in blowout losses to the Seahawks and Indianapolis Colts, the 49ers bounced back with steady offensive plays, stingy defense and fewer penalties.
Gore's 153 yards rushing (on 20 carries) matched the fifth-highest total of his storied career, and his most since December 2009 against Arizona (167 yards). He had 142 yards through the first three games.
"He's a Hall of Fame running back. You have to get him the ball," quarterback Colin Kaepernick said.
Asked how he rated Gore's "Kaepernicking" celebration, the quarterback responded: "Frank has 10s across the board in everything he does."
Gore's touchdown followed a replay reversal on his previous carry that robbed him of a 1-yard gain. That was Gore's franchise-record 53rd rushing touchdown, and his 14th against the Rams, the most by anyone against them in their history.
"It was a power play, and it got well blocked, he squirted through, broke a tackle and finished it," Harbaugh said. "He was doing a great job all night getting through the first wave (of defenders)."
That effort followed what Harbaugh termed an "erroneous, erroneous" report that Gore may have yelled at him late in Sunday's loss to the Colts. Harbaugh did say that Gore does request the ball on occasion, and did a couple times Thursday night.
In stark contrast, the Rams failed miserably running the ball: 19 carries for 18 yards. Starting tailback Daryl Richardson had 12 carries for 16 yards. Their passing game stunk, too: Sam Bradford completed 19 of 41 passes for 202 yards with one touchdown, one interception and five sacks.
Kaepernick rebounded from two poor outings by passing for 167 yards and two touchdowns. He's combined for 444 passing yards in the past three games after a 412-yard showing in the opener.
Kaepernick virtually iced Thursday's win with a 12-yard, third-quarter touchdown pass to Vernon Davis for a 21-3 lead. Anthony Dixon and Kendall Hunter ran for fourth-quarter touchdowns to erase any thoughts of the Rams forcing overtime for a third straight meeting.
Anquan Boldin put the 49ers ahead with a magnificent, 20-yard touchdown reception 6:22 before halftime. Facing third-and-19, Kaepernick found Boldin streaking open on the right side, and a replay review confirmed Boldin barely stayed in bounds.
That score gave the 49ers their first lead since the season opener. And that Kaepernick-to-Boldin connection came through earlier that drive on a 42-yard completion on third-and-10.
The 49ers reeled off 28 unanswered points before the Rams found the end zone on Lance Kendricks' 6-yard touchdown catch, followed by a two-point conversion run.
OCT. 6 GAME
Houston (2-1) at 49ers
(2-2), 5:30 p.m. NBC