SAN FRANCISCO -- Quarterback Colin Kaepernick passed for 185 yards and ran for a 50-yard touchdown with 2:10 remaining, lifting the San Francisco 49ers to a 27-13 victory over the Miami Dolphins on Sunday at Candlestick Park.
The 49ers improved to 9-3-1, while the Dolphins fell to 5-8, losing for the fifth time in their past six games.
Frank Gore rushed for his 50th career touchdown, a 1-yard plunge in the third quarter, tying Roger Craig and Joe Perry for the San Francisco franchise record. Gore gained 63 yards on 12 carries, giving him 1,035 yards for the season. He cracked the 1,000-yard mark for the sixth time in his career.
Kaepernick completed 18 of 23 passes and posted a passer rating of 100.2. San Francisco wide receiver Michael Crabtree caught nine passes for 93 yards.
Outside linebacker Aldon Smith had two sacks, setting a 49ers single-season record of 19.5, breaking the mark he shared with Fred Dean. He moved within 3.5 sacks of breaking Michael Strahan's single-season NFL record of 22.5, set in 2001.
Dolphins defensive end Cameron Wake had three sacks, all in the first half, giving him 16.5 for the season and 42 for his career, moving him past Bob Baumhower (39.5) and Kim Bokamper (39.5) into seventh place on Miami's career sacks list.
The 49ers built a 6-3 first-half lead on the strength of two David Akers field goals, then took advantage of a Miami mistake to increase their lead to 13-3 early in the third quarter.
The Dolphins forced a San Francisco three-and-out, but Miami return man Marcus Thigpen muffed Andy Lee's punt, and 49ers cornerback C.J. Spillman recovered at the Miami 9.
Fullback Anthony Dixon gained 8 yards on a first-down run around left end, and Gore scored on a 1-yard run.
Thigpen returned the ensuing kickoff 56 yards to the San Francisco 49, and Miami moved into position for Dan Carpenter's 53-yard field goal, cutting the 49ers' lead to 13-6 with 6:53 left in the third.
The 49ers then marched 83 yards on 13 plays for Dixon's 1-yard touchdown run, increasing their lead to 20-6 with 14:27 left to play. Kaepernick hit Crabtree twice on the drive, for 13 yards then 10. Rookie running back LaMichael James, suiting up for the first time in his NFL career, broke loose for 13 yards, and Gore had a 19-yard burst.
The Dolphins wouldn't go away. They drove 75 yards on 13 plays for a touchdown, Ryan Tannehill hitting tight end Randy Fasano on a 3-yard scoring pass with 7:55 on a fourth-and-goal play, cutting San Francisco's lead to 20-13.
Fasano made a spectacular diving catch in the back left corner of the end zone, getting a step behind 49ers safety Donte Whitner and pulling the pass in with his right hand.
Miami's defense forced a quick punt, and Tannehill went to work again from his 38. The Dolphins quickly moved to the 49ers' 35-yard line, gaining a 15-yard chunk on a roughing-the-passer penalty on linebacker NaVorro Bowman.
That's as far as the Dolphins got. Tannehill threw four consecutive incomplete passes, and the 49ers took over.
Kaepernick's 50-yard touchdown run pushed the 49ers' lead to 27-13.
James, a second-round draft pick from Oregon, returned the opening kickoff 34 yards and gained 10 yards around left end on his first NFL carry, early in the second quarter. He wound up with eight times for 30 yards.
NOTES: Niners veteran running back Brandon Jacobs, who has complained via social media about his lack of playing time, was inactive. He has five carries this season, all during the previous two games. ... San Francisco backup wide receiver Mario Manningham (shoulder) was inactive. Rookie wideout A.J. Jenkins, a first-round draft pick, suited up for the 49ers for the third team. In his previous two games -- the opener vs. Green Bay and last week at St. Louis -- he didn't get any snaps. ... 49ers defensive tackle Demarcus Dobbs suffered a right knee injury with 4:30 left in the first half. He didn't return. ... Miami starting outside linebacker Koa Misi injured an ankle early the third quarter.