Colin Kaepernick set an NFL rushing record for a quarterback with 181 yards and scored twice as the San Francisco 49ers beat Green Bay, 45-31, in an NFC Divisional Playoff.

Kaepernick, who was born in Milwaukee and grew up as a Packers fan, outplayed reigning MVP Aaron Rodgers and helped the 49ers reach the NFC Championship Game for the second straight year.

Sam Shields picked off Kaepernick's second pass of the game and returned it 52 yards for a score, but the second-year player took over on the ground by running for touchdowns of 20 and 56 yards. He also completed 17-of-31 passes for 263 yards with a pair of scores to Michael Crabtree, who had nine catches for 119 yards. Frank Gore had 119 yards and a TD on 23 carries.

"He does a great job of responding. He's done that every time he's thrown an interception, safety, or turnover," 49ers coach Jim Harbaugh said of Kaepernick. "He's responded with a scoring drive. That's a rare quality. He's shown he's had the ability to come back."

The performance by Kaepernick in his first playoff game shredded the previous QB rushing record for any game, set by Michael Vick (173) in 2002. It was also the most rushing yards for the 49ers in their postseason history.

"It's a great accolade. It means a lot to this team," Kaepernick said of the record.

The NFC West champion 49ers will play either Seattle or Atlanta in next Sunday's NFC Championship Game. The 49ers, seeded second, will host next weekend's contest if Seattle wins or could play the top-seeded Falcons on the road.

Rodgers finished 26-of-39 for 257 yards with a pair of scores and an interception, but the NFC North champions were eliminated from the playoffs one week after beating Minnesota in the Wild Card round.

"It's pretty frustrating," Rodgers said. "To go out and play like that is disappointing. We didn't do enough on offense to help our defense."

One more win by the 49ers would send them to the Super Bowl for the first time since the 1994 season. They lost to the Super Bowl champion New York Giants in the NFC title game last year.

The 49ers piled up 579 yards and turned what was a close game at halftime into a safe margin thanks to the feet of Kaepernick.

Mason Crosby's 31-yard field goal bent inside the right upright with 8:25 left in the third quarter to cap an 89-yard march for the Packers to tie the game at 24.

Less than two minutes later, Kaepernick broke free down the right sideline on a 56-yard scoring run.

"We didn't handle the read-option very well and we didn't handle the quarterback runs from out of the pocket," Packers coach Mike McCarthy said.

The backbreaking score by the 49ers came on the first play of the fourth quarter when Gore broke off right tackle and surged to the end zone for a 2-yard score to cap a 93-yard drive. The key play in the march was Kaepernick's 44-yard connection to Vernon Davis.

After another Green Bay punt, the 49ers stretched their lead to three touchdowns courtesy of Anthony Dixon's 2-yard run to finish another 93-yard trek. San Francisco was able to move the chains on a 4th-and-1 from the Green Bay 18 when B.J. Raji jumped offside.

Rodgers threw a 3-yard score to Greg Jennings with 57 seconds remaining.

The Packers took the lead just four plays into the contest thanks to Shields' 52-yard interception return. Faced with a 2nd-and-6 from the San Francisco 47, Kaepernick scrambled and tried to get the ball to Davis on the left side, but Shields stepped in front of the veteran tight end and raced down the sideline for the easy score.

The 49ers tied the contest on their second possession when, on 3rd-and-8, Kaepernick stepped up in the pocket and darted to the left side for a 20-yard scoring run.

"It's a lot easier on me when other people are making plays. Our offensive line dominated up front," Kaepernick said.

James Jones made a leaping, juggling catch for a 44-yard gain down the right sideline to set up Green Bay's second score. The completion came on 3rd-and-5, and on the next play, DuJuan Harris found a hole up the middle for an 18-yard TD run with 29 seconds left in the opening quarter for a 14-7 difference.

The 49ers took advantage of a muffed punt return from Jeremy Ross early in the second quarter to tie the game. The ball went through Ross' hands, and C.J. Spillman pounced on it at the 9-yard line. Three plays later, from the 12, Kaepernick found Crabtree over the middle and the wide receiver squeezed between defenders to the end zone.

San Francisco went back in front, 21-14, midway through the second quarter on Kaepernick's 20-yard TD pass to Crabtree. Tarell Brown's picked off a bomb by Rodgers, and the veteran cornerback's 39-yard return set the hosts up at the Green Bay 48.

On 3rd-and-9 from the 24, Kaepernick scrambled up the middle for 15 yards before being sandwiched by defenders. A fired-up Kaepernick was penalized for taunting after spinning the ball at the feet of the defenders, but two plays later he threaded the needle to the goal line for Crabtree, who was in tight coverage with Shields, putting the 49ers ahead again with 5:26 left until halftime.

Rodgers connected with Jones on a 20-yard scoring strike with 2 1/2 minutes remaining in the second quarter, but the 49ers grabbed a 24-21 lead at the break thanks in part to the speed of Kaepernick.

On 3rd-and-10, Kaepernick scrambled 18 yards to the Green Bay 40. The drive stalled before David Akers kicked a 36-yard field goal on the half's final play.

Game Notes

Before Saturday, the Packers had won four of the five playoff meetings between the teams ... The 49ers won at Green Bay, 30-22, in the opening week of the season ... Jennings had six catches for 54 yards, while Harris gained 53 yards on 11 carries.