SANTA CLARA, Calif. (AP) — Brock Purdy’s day started with a botched audible that led to a crushing hit and ended with an emotional hug with his family and congratulations from Tom Brady.

In between came a stretch of nearly flawless play that made Purdy’s first career start a very successful one.

Purdy threw two touchdown passes and ran for another score, and San Francisco’s vaunted defense spoiled Brady’s Bay Area homecoming with a 35-7 victory over the Tampa Bay Buccaneers on Sunday.

Purdy — the final pick in this year’s draft — became the first quarterback ever to best Brady in his first start, earning the postgame congratulations from the NFL’s most accomplished quarterback.

“It was surreal just standing there like, man, that’s Tom Brady talking to guys and dapping guys up. For him to have respect for what I did, it was pretty cool. I’m not going to lie,” Purdy said. “Being a little kid, watching that guy kill it throughout all these years in Super Bowls, to be able to give him a high five at the end was pretty cool.”

Purdy’s day got off to a painful start when he was flattened on a blitz by Keanu Neal on the first play. Neal was flagged for roughing the passer.

Purdy said the hit woke him up and he responded by leading the Niners (9-4) to one of their five touchdowns on their first seven possessions when Samuel scored on a 13-yard run.

“We’ve got a quarterback,” defensive end Nick Bosa said. “I always had a lot of confidence in him, but obviously it’s the NFL and you’ve got to go perform and he did that pretty darn good.”

About the only thing that didn’t go right for the 49ers was an ankle injury to Samuel in the second quarter. Samuel was taken away on a cart in tears. Coach Kyle Shanahan said after the game that Samuel didn’t break any bones but likely sustained a high ankle sprain.

San Francisco already led 21-0 at that point thanks to Purdy’s 2-yard touchdown run and his 27-yard TD pass to Christian McCaffrey.

He capped a near-perfect first half with a 32-yard TD pass to Brandon Aiyuk, joining Don Strock (1975) as the only players to throw at least two TD passes and run for another in the first half of their first career start, according to Sportradar.

“I’m really not shocked,” linebacker Fred Warner said. “I know everybody else kind of was wondering how Brock Purdy was going to play. … When you see that ball flying in the air, scoring touchdowns, 28 points at the half, that’s big-time football.”

McCaffrey, who ran for 119 yards, added a TD on the ground with a 38-yard run after Brady was intercepted by Tashaun Gipson on the first drive of the third quarter.

Brady, playing just his second road game against the team he rooted for while growing up in nearby San Mateo, was intercepted again on the next possession by Dre Greenlaw and didn’t lead the Bucs to a score until a deflected TD pass to Russell Gage late in the third quarter.

Brady finished 34 for 55 for 253 yards with one TD and the two interceptions.

“It’s easy to say everyone’s got to play better, but we’re just not playing,” Brady said. “We have just not played consistently well very often. We haven’t played it for four quarters. Maybe we played it a little bit at times but not today at all.”

Despite the lackluster performance, the Bucs still have a one-game lead over Atlanta and Carolina in the NFC South and are in line for a home playoff game if they close it out.

SOUVENIR HUNTING

After the game, Greenlaw and Gipson went up to Brady with the balls they had intercepted and asked to get them signed.

“The worst thing he could tell me was no,” Greenlaw said. “I was always told, you don’t ask, you never know. He’s a good guy to sign that ball after he threw those picks was big time. I appreciate it. He’s the greatest. He’s the GOAT. I appreciate that.”

REPLAY CONFUSION

Purdy’s long touchdown pass to McCaffrey was originally ruled a catch, then announced as an incompletion before the officials announced they were going to review the play because McCaffrey bobbled the ball.

With no clear evidence of whether McCaffrey’s second foot hit out of bounds before he controlled the ball, referee Brad Allen announced that the initial call of a TD would stand.

INJURIES

Bucs: NT Vita Vea (calf), CB Zyon McCollum (concussion), CB Jamel Dean (toe) and LB Joe Tryon-Shoyinka (hip) all left with injuries.

49ers: Purdy hurt his oblique but was able to play through it. … San Francisco lost Samuel, DT Kevin Givens (knee), CB Samuel Womack (head), CB Dontae Johnson (knee) and DL Kerry Hyder Jr. (ankle).

UP NEXT

Bucs: Host Cincinnati on Sunday.

49ers: Visit Seattle on Thursday night with a chance to clinch the NFC West.