SAN FRANCISCO — Fourth down and 2 yards to go at the Green Bay 36 with exactly three minutes left in the game, the 49ers nursing a 31-28 lead, and everyone in the house knew exactly where Colin Kaepernick's pass was heading. Presumably, that included the visiting Packers, but they were powerless to stop it.

Kaepernick rolled right, waited for Anquan Boldin to separate himself from a defender and coolly dropped in the ball for a 15-yard gain and a first down.

There would be other developments in the final couple of minutes — a 49ers field goal, a long completion to Randall Cobb with time running out, a game-ending pressure by linebacker Aldon Smith — but the fourth-down conversion is what really sealed the Niners' 34-28 victory on Sunday at Candlestick Park, and it's appropriate that Boldin was involved.

Stepping in for injured No. 1 receiver Michael Crabtree, Boldin — who burned the 49ers for six catches, 104 yards and a touchdown in Super Bowl XLVII in February before coming to San Francisco in an offseason trade — made the transition easier than anyone could have expected. The wideout caught 13 passes (tied for fourth in team history) for 208 yards (eighth in team history) and a score, repeatedly finding himself open in the Green Bay secondary, and wrestling the ball away from overmatched defensive backs or making one-handed grabs when he wasn't.

"They kept letting him get open and, I mean, he played like a grown man today," Kaepernick said. "He made plays even when he shouldn't have."

As 49ers coach Jim Harbaugh said of Boldin: "We did give up a (sixth-round) draft choice for him and (are) paying him a lot of money. But definitely think he's worth every penny."

For the record, Boldin is making $6 million this year. It will take more than one big game to justify that, but the 11-year veteran is well on his way. And he wasn't the only 49ers target doing damage against Green Bay. Tight end Vernon Davis caught six passes for 98 yards and two touchdowns.

The Packers, humiliated by the playoff collapse last year, came into the 2013 season opener determined to keep Kaepernick in the pocket, and to limit Frank Gore's effectiveness on the ground. They largely accomplished those tasks, more or less daring Kaepernick to beat them through the air. He accommodated, shredding the visitors for 412 yards and three touchdowns.

Kaepernick was the first 49ers quarterback to pass for 400 yards since, improbably, Tim Rattay did it against Arizona on Oct. 10, 2004.

"I keep telling people how good of a quarterback he is," Boldin said of Kaepernick. "Everybody looks at how athletic he is and that he's a 'running quarterback,' but he is a quarterback first. Being able to run is just a bonus for him."

It took all of those Kaepernick passing yards to subdue the Packers, who fought back from a deficit three times and took their first lead of the game, 28-24, on a 2-yard run by rookie running back Eddie Lacy with 8:26 to play.

It was a critical moment for the 49ers, who responded with a nifty drive that moved 50 yards downfield and, more important, killed 4:26 of the final 4:52, aided by that fourth-down throw to Boldin. The Niners had initially tried to draw the Packers offside on fourth-and-2, then ran the fateful play after dual timeouts.

It certainly wasn't a perfect day for the 49ers, who had difficulty running the ball against Green Bay for most of the game. They wound up with 90 yards on 34 carries, a 2.6-yard average, and it was even worse in the first half: 12 attempts, 16 yards, 1.3 per carry.

The Niners finally jump-started the run game late in the contest. Kendall Hunter's 32-yard run midway through the fourth quarter helped set up Gore's 1-yard touchdown plunge, which gave San Francisco a 31-28 lead.

On defense, the Niners missed several tackles, most of them in the secondary, and had a hard time covering the receiving duo of Cobb and Jordy Nelson, both of whom were over 100 yards for the day. The pass rush was inconsistent.

"I felt we kind of contributed to them having some of the success they had," linebacker Patrick Willis said. "We missed some tackles out there and gave them some first downs. They scrambled a little bit and threw it up and caught some passes. I think that's more our fault than them dominating."

This was one of the most highly anticipated games of the Week 1 slate, and it didn't disappoint. It was tied 7-7 after the first quarter, 14-14 after the second and 21-21 after the third as the two offenses traded touchdowns — all of them on pass plays. The 49ers had a couple of takeaways — a fumble recovery by Tarell Brown that set up a touchdown, and an interception by rookie safety Eric Reid on a ball that Packers tight end Jermichael Finley tipped right to him. San Francisco did not turn over the ball.

All in all, it was a great start for the 49ers in their quest to get back to the Super Bowl. But the warm, fuzzy feeling wouldn't last for long, not with a looming trip to Seattle to face the archrival Seahawks next weekend.

Asked how long he would enjoy the win over the Packers, Willis said: "Until (Monday) morning. I'll enjoy it tonight with my family, hang out with them, and then tomorrow when I get to the facility it's about working out and getting my mind ready for Seattle."

<I>You can reach Staff Writer Phil Barber at 521-5263 or phil.barber@pressdemocrat.com.</I>