Ryan Clark talks about what worked for the Patriots against the 49ers and what having home field could mean for New England. (1:48)

Pats being on track for home field is bad news for rest of AFC (1:48)

SANTA CLARA, Calif. -- In a moment that seemed more fitting for a Hollywood script than an NFL game, Tom Brady's homecoming to the Bay Area ended with a rainbow over Levi's Stadium to cap off what he called "a very special day."

As he often has over his 17-year career, Brady rose up in the clutch with two remarkable plays to help the New England Patriots pull away from the San Francisco 49ers in a 30-17 victory.

On his third touchdown, he spun in the pocket to avoid the rush before falling backward while somehow finding Danny Amendola in the end zone. Bill Belichick called it a "tremendous play."

On the fourth, Brady once again worked his magic in the pocket by moving forward and throwing a 24-yard dart on the run to receiver Malcolm Mitchell, with Mitchell racing the rest of the way for the score. Another terrific play.

It wasn't always pretty, but Chris Long and the Patriots enjoyed a beautiful ending to Sunday's game at Levi's Stadium. Ezra Shaw/Getty Images

Then came the cheers from the largely pro-Patriots crowd at the 49ers' home field at Levi’s Stadium.

“Brady! Brady! Brady!”

"For the first chance to ever do that, it was pretty special," Brady said of playing the 49ers on the road for the first time. "I felt it in pregame warmup and it carried right to the last play of the game. It was pretty great."

While Brady led the Patriots to victory, it wasn’t the convincing result many had hoped for against one of the NFL’s worst teams, as the Patriots’ defense struggled early and the offense fell into a funk in the second quarter and the early part of the second half. So there still are lingering questions about this team’s big-picture Super Bowl hopes.

But more than anything, the game provided a reminder that the 39-year-old Brady -- who was scuffling at times by relying too much on receiver Julian Edelman as top weapons Rob Gronkowski (chest) and Chris Hogan (back) were out -- still can turn it on when the team needs it most. He looked like a different player in the final 19 minutes of action when he began distributing the football to players other than Edelman, with rookie Malcolm Mitchell among those rising up most in the clutch.

That, in addition to Brady’s ability to extend plays in the pocket, was the key to the offense coming to life.

"He made a lot of clutch plays scrambling and giving guys time to get open," said running back Dion Lewis, who made his season debut and played 22 snaps. "That's a great part of his game that nobody really thinks he has."

Said 49ers coach Chip Kelly, "His ability to move and keep things alive in the pocket is really what makes him such a good quarterback."

As for where the Patriots (8-2) go from here, they visit the New York Jets on Sunday.

What you need to know in the NFL • NFL playoffs coverage, schedule

• Statistics

• Scoreboard

• Complete 2016 schedule, results

• Standings

The possibility of getting Gronkowski and Hogan back should help the offense, while questions remain about the defense -- which played without Jabaal Sheard on Sunday as a healthy scratch -- and its ability to come through when the team needs it most.

As for who the Pats turn to when they need help most in adverse situations, there’s never been a question about that in recent years.

It’s Brady, as he showed again in his homecoming to the Bay Area.