MINNEAPOLIS — Cast aside once by the Eagles, Nick Foles delivered Philadelphia its first Super Bowl title, and he outdueled the great Tom Brady to do it.

Foles, who took over when Carson Wentz injured his right knee in mid-December, matched the five-time champion and three-time MVP big play for big play Sunday in leading the Eagles past the New England Patriots, 41-33.

Foles threw the go-ahead touchdown pass to tight end Zach Ertz from 11 yards on third-and-7 with 2:21 remaining, capping a seven-minute, 14-play drive that covered 75 yards, kept Brady cooling his cleats on the sideline and allowed the Eagles’ exhausted defenders to catch their breath in a game that featured 1,151 total yards, the most in any NFL game in the Super Bowl era.

Brady threw for more yards – a playoff career-high 505 to Foles’ 373 – but Foles matched Brady’s three touchdown tosses and even caught one.

He hauled in tight end Trey Burton’s toss from the 1 that gave Philadelphia a 22-12 halftime edge and made him the first player in Super Bowl history to be on both ends of a touchdown pass in the same game.

Brady nearly beat him to it, but couldn’t quite haul in receiver Danny Amendola’s high pass for what would have been a nifty over-the-shoulder reception.

Foles’ only interception was a fluke, but it did help Brady and the Patriots stay in it until the very end, when Brady’s desperation pass into the end zone on the final play failed to find a Patriots receiver.

Foles was 28 of 43 and wasn’t sacked. Brady was 28 of 48, and while he didn’t throw any interceptions, his only sack was costly.

Brady, who threw TD passes on New England’s first three second-half drives, was attempting a pass on second-and-2 at his 33 when Brandon Graham swept in and jarred the ball loose. Derek Barnett smothered the fumble at the Patriots 31 with just over two minutes remaining.

Jake Elliott’s 46-yard field goal made it an eight-point cushion and gave Brady just a minute to work his magic.

He started at his 9 with 58 seconds remaining and drove the Patriots to midfield before time ran out.

A third-round pick by the Eagles coach Andy Reid in 2012, Foles had tremendous success as a starter under Chip Kelly in his second season. He threw 29 TDs and only two interceptions in 11 starts in the 2013 season, including the playoffs. Foles posted a passer rating of 119.2, third-highest in league history. He tied an NFL record with seven TD passes in a game at Oakland in November 2013 and won an offensive MVP award at the Pro Bowl.

But Foles was traded to St. Louis for Sam Bradford in March 2015. He lost his starting job to Case Keenum and asked for his release after Jared Goff was drafted No. 1 overall. Foles considered hanging up his cleats before Reid persuaded him to go to Kansas City to be Alex Smith’s backup.

After one season with the Chiefs, Foles returned to Philly this season. Now he’s a folk hero for a franchise that had gone 0 for 2 in Super Bowls and for a legion of fans who were rooting for anybody other than Brady and the Patriots.