Kaepernick ran for a game-winning, two-point conversion, and the 49ers rallied from a 14-point deficit to snap a 13-game skid with a 22-21 victory over the Los Angeles Rams on Saturday at the Memorial Coliseum.
"In my head it was just 'I have to get in, I have to get in for this team, we need this win,'" Kaepernick said regarding the conversion. "I was very excited to do that."
Kaepernick connected with wide receiver Rod Streater with 31 seconds remaining to pull the 49ers (2-13) within 21-20 before converting the two-point attempt. An interception by San Francisco cornerback Rashard Robinson with 16 seconds left sealed the win.
It ended one of the most frustrating periods in 49ers' franchise history.
"It reveals the character of this team and players," Kaepernick said. "I think the ability to continue to fight, to continue to try to do your job every play and remain focused in spite of the circumstances that you're in I think is huge, and it shows the type of character this team has."
Kaepernick completed 28 of 38 passes for 257 yards with two touchdowns and an interception.
San Francisco hadn't won a game since beating the Rams in the season opener on Sept. 12.
"Again, like I said, I was really excited for our players," San Francisco coach Chip Kelly said. "They've done everything as a coaching staff that we've asked them to do. And they deserved it. They've worked for it."
Rams quarterback Jared Goff was 11 of 24 for 90 yards with a touchdown and two interceptions as the Rams (4-11) dropped their sixth game in a row.
"It's horrible. I don't know what else to say," Rams defensive tackle Aaron Donald said. "We just keep losing and we just need to keep trying to find ways to win and finish games. Definitely frustrating. I'm tired of going home mad every week."
Tramaine Brock set up the 49ers' initial score, picking off a Goff attempt and returning it 38 yards to the Rams' 17 with 9:38 left in the first quarter. Two plays and 37 seconds later, Kaepernick connected with running back Carlos Hyde for a 19-yard scoring pass for a 7-0 San Francisco advantage.
The Rams tied it on a one-yard run by running back Todd Gurley with 4:07 remaining in the first.
An interception of Kaepernick by safety Cody Davis led to the Rams' next score. On the first play, Tavon Austin took a handoff from Goff and raced 30 yards to the end zone for a 14-7 Rams' lead at 2:33 of the first.
In the fourth, Hyde fumbled a short reception after a hit by cornerback E.J. Gaines. Defensive end Morgan Fox recovered it at the 49ers' 25. Hyde suffered a knee injury on the play and did not return.
Goff tossed a 2-yard touchdown pass to tight end Tyler Higbee for a 21-7 lead at 10:32 of the fourth.
Kaepernick's 13-yard touchdown run cut the gap to 21-14 with 5:06 remaining before he delivered the game-winner.
"We had the game," said Austin, who had two catches for 14 yards in addition to the touchdown run. "We were up by 14 in the fourth (quarter) and we gave it away. That's where we're at right now. We got one more game left. So hopefully, we finish strong."
Austin added that too many miscues cost the Rams dearly.
"Basically, just making dumb mistakes like we've been doing previously," Austin said. "Not making the big play we need to. Basically, just losing focus."
Rams wide receiver Kenny Britt left the game with a shoulder injury early in the third quarter and did not return. Britt had one catch for 15 yards, allowing him to top 1,000 yards for the first time in his career. Britt, who has 68 receptions for 1,002 yards, is the first Rams receiver to go over 1,000 yards receiving since Torry Holt in 2007.
NOTES: Los Angeles P Johnny Hekker set an NFL record with punts downed inside the 20-yard line with 50. ... Rams QB Case Keenum and T Greg Robinson were healthy scratches. Sean Mannion served as backup the QB. WR Michael Thomas (hip), S Maurice Alexander (concussion) and DB Lamarcus Joyner were also inactive for the Rams. ... 49ers inactives included DL Glenn Dorsey (ribs/knee), CB Dontae Johnson (groin), C Marcus Martin (ankle), T Joe Staley (hamstring) and QB Blaine Gabbert. ... Both clubs close out the season at home Jan. 1. The 49ers face the Seattle Seahawks, while the Rams play the Arizona Cardinals.