SAN FRANCISCO -- The San Francisco 49ers were clinging to a 20-13 lead late in the fourth quarter Sunday against Miami when they called a read-option run, a play quarterback Colin Kaepernick could run in his sleep.
Kaepernick, who rushed for 4,112 yards and 59 touchdowns in college for Nevada, faked a handoff on third-and-five to running back Frank Gore, pulled the ball back and hit a huge gap off left tackle. He raced 50 yards for a touchdown with 2:10 left, lifting the 49ers to a surprisingly hard 27-13 victory over the Dolphins at Candlestick Park.
Niners coach Jim Harbaugh said it was a "great call" by offensive coordinator Greg Roman. "And it was a big third-down conversion. We'd been struggling on third downs. And to get that one to pop and get the touchdown was great. So it was better than having to punt it back to Miami at that point."
Kaepernick also passed for 185 yards, completing 18 of 23 passes, nine of those completions going to wide receiver Michael Crabtree for 93 yards. He posted a passer rating of 100.2, helping the 49ers bounce back from last week's loss at St. Louis and improve to 9-3-1.
"He acquitted himself very well in this game," Harbaugh said of Kaepernick. "Made some big-time throws. Ran our offense. Did a good job of running the ball."
Kaepernick started his fourth straight game since replacing Alex Smith and improved to 3-1 heading into a brutal two-game stretch of road games against New England then Seattle where he'll be severely tested.
Kaepernick, though, said he's "been comfortable this whole season" in all situations.
The Dolphins fell to 5-8, losing for the fifth time in their past six games, but they gave the 49ers all they could handle. Trailing by a touchdown, they marched to the San Francisco 35 and had a first down with 4:35 left to play, but quarterback Ryan Tannehill threw four consecutive incomplete passes, and the 49ers took over.
"You've got to make a play," Dolphins guard Richie Incognito said. "We've got to move the ball. We couldn't make a play when it counted."
Tannehill completed just 17 of 33 passes for 150 yards and one touchdown, and the Dolphins were held to 17 points or less for the fourth time in their past five games.
Gore rushed for only 63 yards and one touchdown on 12 carries, but he reached two milestones. He rushed for his 50th career touchdown, a one-yard plunge in the third quarter, tying Roger Craig and Joe Perry for the San Francisco franchise record. He also cracked the 1,000-yard mark for the sixth time in his career with 1,035 yards and counting.
"It's a blessing, where everybody says when you turn 29 you can't do it no more," Gore said. "When I got to 29 (on May 14), I told myself I was going to overcome that."
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.
Smith attacked a makeshift Dolphins offensive line that held up well despite being without Pro Bowl left tackle Jake Long, who went on injured reserve Tuesday with a triceps injury. Rookie Jonathan Martin moved from right tackle to left, while Nate Garner made his first start of the season at right tackle.
"It was decent," Martin said of his performance against Smith. "He got me on that one bull rush pretty good. There is a reason why he is one of the best pass rushers in the league. He is a good player. It is a really talented defense, talented D-line."
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' offense unveiled a new weapon Sunday, activating rookie running back/kick returner LaMichael James for the first time this season. James, a second-round 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 carries for 30 yards with a long of 13, gaining most of those yards on zone-read plays like he ran in college.
"I'm happy for him," Gore said. "He did a hell of a job."
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 eight yards on a first-down run around left end, and Gore scored on a one-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 one-yard touchdown run, increasing their lead to 20-6 with 14:27 left to play.
The Dolphins, though, wouldn't go away. They drove 75 yards on 13 plays for a touchdown, with Tannehill hitting tight end Randy Fasano on a three-yard scoring pass with 7:55 left 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.
"That's a team that's better than their record," Whitner said. "They've got a bunch of hungry guys. We're getting everybody's best effort. Every team we've played has been giving us their best shots. These next three games aren't going to be easy."
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. Moments later, Kaepernick took off on his 50-yard touchdown run, securing San Francisco's victory.
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 time. He got into the game but didn't catch a pass. 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 in the third quarter and did not return.