SANTA CLARA, Calif. - Nick Novak kicked a 40-yard field goal nearly five minutes into overtime after Philip Rivers rallied San Diego back from a 21-point deficit in the second half, keeping the Chargers' slim playoff hopes alive with a 38-35 victory over the San Francisco 49ers on Saturday night.

Rivers threw a tying 11-yard touchdown pass to Malcom Floyd with 29 seconds left in regulation after completing a pair of fourth-and-longs as the Chargers forced overtime.

Phil Dawson's 60-yard field goal attempt as regulation ended fell way short.

Rivers converted fourth-and-8 and fourth-and-10 on the key final San Diego drive in regulation.

Colin Kaepernick ran for a 90-yard touchdown in the third quarter before Rivers rallied his team with its playoff hopes hanging in the balance.

Frank Gore had an early 52-yard touchdown run to get it started six days after a concussion, but his third-quarter chop block negated a 63-yard touchdown catch and run by Vernon Davis. Then, Kaepernick was sacked and fumbled the very next play in a wild sequence. Kaepernick, holding the ball out and away from his body, was clobbered by Ricardo Mathews to force the fumble and Corey Liuget recovered for the touchdown.

Rivers threw touchdown passes of 21 and 1 yard to Antonio Gates and another to Eddie Royal, but also was hurt by three interceptions. On one of those, Antoine Bethea ran an interception back 49 yards for his first career touchdown, and a defense minus recently released starting lineman Ray McDonald never let Rivers find a rhythm.

Kaepernick's long run is the second-longest in 49ers history. Terrelle Pryor's 93-yard run for Oakland last year against Pittsburgh was the longest by a QB.

The 31-year-old Gore is in position for the final game next weekend against Arizona for a fourth consecutive 1,000-yard season and eighth in his 10 NFL seasons.