San Francisco 49ers quarterback Colin Kaepernick (7) passes against the Green Bay Packers during the second quarter of an NFC divisional playoff NFL football game in San Francisco, Saturday, Jan. 12, 2013. (AP Photo/Tony Avelar)

SAN FRANCISCO — Colin Kaepernick ran for a quarterback playoff record 181 yards and two touchdowns and threw two scoring passes to Michael Crabtree in leading the San Francisco 49ers back to the NFC championship game with a 45-31 victory against the Green Bay Packers on Saturday night.

Playoff first-timer Kaepernick outshined reigning NFL MVP Aaron Rodgers, who never got in sync for the Packers (12-6) in finishing 26 of 39 for 257 yards with two touchdowns.

Kaepernick ran for scores of 20 and 56 yards on the way to topping the rushing mark of 119 yards set by Michael Vick in 2005 against St. Louis. Crabtree caught TD passes of 12 and 20 yards in the second quarter and wound up with nine receptions and 119 yards for the Niners (12-4-1) in the NFC divisional matchup.

San Francisco had 579 total yards, 323 on the ground.

Kaepernick, the second-year pro out of Nevada who supplanted Alex Smith at quarterback in a much-debated move by coach Jim Harbaugh, shook off an interception that Sam Shields ran back 52 yards for a touchdown on San Francisco's first possession to twice rally the 49ers from a TD behind.

Kaepernick's 56-yard TD run on a read-option keeper in the third quarter — the longest by a quarterback in franchise history — gave the 49ers a 31-24 lead. He stopped in the end zone and flexed his right arm, smiling all the way back to the sideline.

The scores mark the fourth time in NFL history a player had two touchdowns rushing and two touchdowns passing in a postseason game.

Kaepernick also led another drive that David Akers finished with a 36-yard field goal to put the 49ers ahead 24-21 as the first half ended.

Frank Gore also ran for a 2-yard touchdown 3 seconds into the fourth quarter to extend San Francisco's lead to 38-24.

Rodgers rallied the Packers after tossing his own interception. The former Cal star threw a 20-yard scoring strike to James Jones, and DaJuan Harris ran for an 18-yard touchdown.

The amped-up crowd at Candlestick Park endured a flurry of emotions at the start.

With San Francisco looking to return to the NFC title game for the second straight season, Kaepernick's costly error quieted the 49ers faithful. Shields stepped in front of Kaepernick's pass, shook the quarterback to the ground and scampered down the sideline to give the Packers a quick 7-0 lead.

Kaepernick unclipped his jaw strap and dropped his head to the sideline while Shields waved his hands at the crowd. Rodgers pumped his fist on the Packers sideline.

Kaepernick converted two third downs to bring the 49ers back on their next drive. He bought time and scurried out of the pocket to find running back Gore for a 45-yard gain, then darted 20 yards up the middle on third-and-8 for the tying score.

When Rodgers and the Packers offense finally took the field, they didn't do much the first time out. San Francisco stopped Rodgers, who had a contingent of friends and family make the 4-hour trek from his hometown of Chico, on a three-and-out that whipped the crowd back into a frenzy on a crisp night along the bay.

Rodgers found his groove and floated a 44-yard pass that Jones leaped to snatch over two defenders along the sideline. Then Harris broke through the middle to put the Packers up 14-7 on the next play.

Green Bay made its share of mistakes, too.

Jeremy Ross muffed a punt and Chris Spillman recovered at the Packers' 9. Three plays later, Kaepernick found Crabtree running free over the middle for a tying 12-yard touchdown pass.

San Francisco's stout defense often took a linebacker off the field to drop an extra defensive back in coverage against Rodgers, just as the 49ers did in a 30-22 win in the season opener at Lambeau Field. The strategy flustered Rodgers enough that he overthrew Jordy Nelson on a deep pass that Tarrell Brown intercepted. Rodgers had gone 184 passes without an interception.

Kaepernick broke another 15-yard run on third down, but officials whistled him for a 15-yard taunting penalty for tossing the ball in the direction of Green Bay defenders. He brushed that off to hit Crabtree on a 20-yard touchdown pass to give the 49ers a 21-14 lead midway through the second quarter.

On its next series, Green Bay took advantage of a 15-yard personal foul penalty Dashon Goldson was given for a helmet-to-helmet hit on Harris. Rodgers then threaded a tying 20-yard TD to Jones between three defenders in the end zone with 2:33 remaining. Kaepernick responded and led the 49ers downfield to give the struggling Akers, who had to beat out Billy Cundiff to keep his job, a chance.

Rodgers led the Packers on a nine-play 76-yard drive midway through the third quarter. Mason Crosby kicked a 31-yard field to tie the game at 24 in the third quarter