CHAPEL HILL, N.C. -- Devin Carter and two teammates took a North Carolina State flag and planted it at rival North Carolina's midfield logo amid a wild celebration.
The Wolfpack spiked weeks of frustration with a signature road win to end the regular season.
"It was just spur of the moment," Carter said. "It was amazing to go out there like that. It's joy."
Ben Finley threw for 271 yards and two touchdowns in his first career start, and N.C. State beat Drake Maye and No. 18 North Carolina 30-27 on Friday when Noah Burnette duck-hooked a 35-yard field goal try in the second overtime.
Maye connected with Antoine Green from 4 yards out on the final play of regulation to tie the game at 24-all, but N.C. State (8-4, 4-4 Atlantic Coast Conference) kept the ACC Coastal Division champion Tar Heels (9-3, 6-2) out of the end zone in the first overtime.
Burnette - who also missed from 27 yards in the fourth quarter - made a 26-yarder in the first OT and the Wolfpack tied it on Christopher Dunn's 31-yarder. Dunn was good from 21 yards in the second overtime and N.C. State, which never trailed in regulation, handed North Carolina its second straight loss.
"I was running around trying to hug everyone," Finley said.
Finley's older brother, former N.C. State QB Ryan Finley, orchestrated two wins in North Carolina's Kenan Stadium.
"It's nice to keep the Finleys undefeated here," coach Dave Doeren said.
Carter had six receptions for 130 yards and a touchdown for the Wolfpack, who snapped a two-game skid and pulled out a thrilling victory over their in-state rival for the second straight year.
"I loved the way our kids played. They fought their guts out," North Carolina coach Mack Brown said. "They didn't play great in the first half, but they were really good on defense, maybe the best defense we've had this year."
Carter caught Finley's back-shoulder pass just outside the end zone and backed in for a 26-yard touchdown with 3:54 remaining in regulation for the Wolfpack's first points of the second half. Finley was so far down the depth chart that he estimated he hadn't thrown a pass to Carter in a year and a half.
As a fourth-stringer, Finley didn't imagine ending up in this situation.
"Just kind of messing around on the scout team and still getting better," he said.
Finley became N.C. State's fourth starting quarterback in a seven-game span. He completed 27 of 40 passes.
The Tar Heels and freshman sensation Maye closed the regular season with dispiriting one-score losses to Georgia Tech and the Wolfpack ahead of the ACC title game clash with No. 8 Clemson next Saturday.
Maye finished 29 of 49 for 233 yards, one interception and the tying TD toss on fourth-and-goal to Green, which followed an apparent touchdown catch by John Copenhaver that was overturned on a replay review.
"They missed one field goal, and we missed two and that's what the game came down to," Brown said. "I thought about going for it on the fourth-and-3 at the end (in the second overtime), but we were playing really good on defense."
Maye's 14-yard, third-down scramble with 7:53 to play allowed the Tar Heels to pull even for the first time since early in the first quarter.
N.C. State got off to a strong start. After forcing a North Carolina punt, the Wolfpack needed three plays to score on Jack Chambers' 2-yard quarterback keeper.
Finley hooked up with a diving Terrell Timmons Jr. in the end zone from 28 yards out, giving Timmons his first career touchdown early in the second quarter.
Elijah Green's 9-yard run gave the Tar Heels a boost with 5:03 left in the half. Dunn's 29-yard field goal on the last play of the half pushed N.C. State's edge to 17-10.
Dunn broke the ACC scoring record in the first half with his second extra point. In the second half, his 43-yard field goal attempt was wide left, his first miss in 23 chances this season.
North Carolina was without starting cornerback Tony Grimes because of an injury. The Tar Heels lost starting safety Cam'Ron Kelly in the first half and starting cornerback Storm Duck in the second half to game-ending injuries.
N.C. State beat in-state foes East Carolina, Wake Forest and North Carolina by a combined 13 points. "It's awesome to have that," Doeren said.
The Wolfpack and Tar Heels had split two previous overtime games.
N.C. State: The Wolfpack relied on defense to contain one of the country's most explosive offenses. The win was a nice consolation prize for a team that started 5-1 and looked like a contender in the Atlantic Division.
North Carolina: The Tar Heels weren't crisp for most of the game and still nearly pulled off a comeback for the ages. This will sting, particularly given the failure to score a touchdown in OT.
North Carolina could drop out of https://apnews.com/hub/ap-top-25-college-football-poll with consecutive home losses, though losing in two overtimes might temper the damage.
N.C. State: Awaits a bowl invitation.
North Carolina: Prepares to face Clemson for the ACC title in Charlotte.