SEATTLE (AP) — Tom Brady and the best offense in the NFL got upstaged by an undersized rookie.

In the final minutes, it was Russell Wilson and the Seattle Seahawks making all the big plays.

“If guys didn’t believe in him,” Seattle safety Earl Thomas said, “I guarantee they believe in him now.”

Wilson found Sidney Rice behind the secondary for a 46-yard touchdown with 1:18 remaining, and the Seahawks rallied for 14 points in the final 7:31 to stun the New England Patriots 24-23 Sunday.

The matchup between the Patriots‘ No. 1 ranked offense and Seattle’s No. 1 defense instead turned in to a starring performance for Wilson. And a shocking rally that gave Pete Carroll a win in the first matchup against the franchise he coached for three seasons in the late 1990s. Carroll was bouncing around the sideline in celebration after one of his biggest pro victories.

“I hadn’t even thought about that. That was a long time ago and there have been a lot of games,” Carroll said. “I really love Robert Kraft, he’s a great man and he’s been great throughout the years about our separation of sorts. I respect the heck out of him. But I’m a competitor and, heck yeah, I want to win against those guys.”

Wilson hit Braylon Edwards on fourth down for a 10-yard TD to get the Seahawks within 23-17. After a pair of holds by Seattle’s defense, Wilson found Rice streaking open on a double move for his third touchdown pass of the game. Steven Hauschka’s extra point gave Seattle (4-2) the lead with 78 seconds remaining.

Brady had a final chance to make up for all the opportunities the Patriots (3-3) squandered. Starting at his 20 with 1:14 left, Brady missed Brandon Lloyd then was sacked by Jason Jones, the first sack all day by Seattle. His pass for Aaron Hernandez, back after being out since Week 2 with an ankle injury, was incomplete, and Wes Welker was stopped short on fourth down.

Seattle’s winning touchdown came after Carroll showed confidence in his defense. The Seahawks went three-and-out with 3:20 left and Carroll risked never seeing the ball again and punted.

Even though Seattle had three timeouts and the two-minute warning, it was still a risky proposition.

“I wasn’t surprised. As a defense we want the game on our shoulders,” Seattle linebacker Bobby Wagner said. “We have the confidence in us; we know Pete has the confidence in us.”

Seattle forced the Patriots into just their fifth three-and-out of the season and only 14 seconds elapsed before Zoltan Mesko punted. Leon Washington returned the punt 25 yards and Seattle started its winning drive at its 43.

Wilson faked a handoff and looked deep. Rice was on an option route, and the coverage directed Rice to the middle. After faking to the outside, he was wide open.

“It was a heck of a throw. When I came out of my break, the whole time I was looking at the ball in the air and it was so pretty,” Rice said. “I was just running, I was like ‘You’ve got to catch up to it, you’ve got to catch up to it,’ and I was able to track it down.”

Wilson finished 16 of 27 for 293 yards, the best day of his young career. He added Brady to an impressive list of quarterbacks he’s topped this year: Tony Romo, Aaron Rodgers and Cam Newton. It was also the fifth time in six games Wilson found himself in a late drive with the game on the line.

“I think I’m always comfortable no matter the situation, I think I’m just more experienced,” Wilson said. “Being in those situations you have to trust what you see, you have to be quick with your decisions, but also believe in your decisions and just be decisive with the football.”

Brady finished 36 of 58 for 395 yards and touchdown passes of 1 yard to Hernandez and 46 yards to Welker in the first half. Welker had 10 catches for 138 yards, his fourth straight game over 100. Brady topped 300 yards passing for the 49th time, but was intercepted in the second half by Richard Sherman and Thomas after going 179 attempts without being picked off. One of Brady’s interceptions came in the end zone, yet another squandered chance by the Patriots.

New England came away with just one touchdown in six trips inside Seattle’s 20. The most damaging came at the end of the first half when coach Bill Belichick opted to throw with 6 seconds remaining instead of kicking the field goal from the Seattle 3. Brady was flagged for intentional grounding and the ensuing time runoff ended the half.

“You lose by one point and here are a lot of things we could have done better to not be in that situation,” Brady said.

Seattle’s defense gave up a season-high 475 yards after not allowing any of its first five opponents to top 300. The Patriots went eight consecutive drives without punting, and ran 85 offensive plays to the Seahawks’ 55, yet could not get the touchdowns to put Seattle away.