North Carolina State needed a late comeback to defeat North Carolina at home Friday night, but the Wolfpack got the job done.

NC State won 34-30 despite trailing 30-21 with less than two minutes to play. Devin Leary threw 2 touchdown passes that took place 26 seconds apart thanks to a recovered onside kick.

Here’s a clip of the game-winning TD:

North Carolina’s collapse ruined what was a dominant performance for most of the game. The Tar Heels scored 24 unanswered points at one point and controlled play for the majority of the contest.

But Leary was just too much, throwing for 4 touchdowns on the day. Receiver Emeka Emezie caught 5 passes for 112 yards and 2 touchdowns.

This win means North Carolina State is still alive in the race for the ACC Atlantic title. Dave Doeren’s group will clinch the division if Wake Forest loses to Boston College on Saturday.

If the Demon Deacons win, then they will advance to the ACC Championship Game to face Pittsburgh in early December.

For North Carolina, this loss officially ends a disappointing regular season. The Tar Heels began the year with ACC title hopes, but ended up finishing the year at 6-6.