CHAPEL HILL, N.C. -- It was a homecoming game Tar Heels fans won't soon forget.
Down by 18 in the second half, North Carolina coupled a bruising rushing game with a defense that did just enough to stun No. 9 Wake Forest, 58-55, and end the Demon Deacons' undefeated season.
It was Mack Brown's UNC squad that entered the season with high expectations, and even a No. 10 preseason ranking. But after eight games, the Tar Heels sat at 4-4 and searching for a way to salvage a promising season.
A win against a Wake Forest squad that dreamed of a perfect season and perhaps even a playoff berth was just what the Tar Heels needed.
Ty Chandler ran for career highs of 213 yards and four touchdowns to help North Carolina rally from 18 down in the third quarter.
Chandler's big day included a 50-yard breakaway run with 1:12 left. That was the final blow for the Tar Heels (5-4) as they rallied to beat the Demon Deacons (8-1) for the second straight year, following a 21-point comeback last year by erasing a 45-27 deficit with 7:38 left in the third.
The loss doesn't affect the Demon Deacons' pursuit of their first ACC title since 2006 since it was part of a home-and-home nonconference series announced in 2015 with the schools not playing each other as often amid the expanded ACC's scheduling model.
But it likely ends their hopes of climbing deeper into the College Football Playoff race, even if they win out in league play and win the ACC championship game.
Sam Hartman threw for 398 yards and five touchdowns while running for 78 yards and two more scores for Wake Forest. A.T. Perry and Jaquarii Roberson each hauled in a pair of touchdown grabs to lead a 615-yard effort from the offense.
But that high-scoring unit, one of the best of the Bowl Subdivision, stalled at a critical time with three straight empty drives against a much-maligned Tar Heels defense that had struggled to show many tangible signs of improvement this season.
Sam Howell threw for 216 yards and a touchdown while running for 104 and two more scores in a matchup of high-profile quarterbacks. He helped the Tar Heels post 546 yards and set up a tiebreaking 25-yard field goal by Grayson Atkins with 2:12 left.
The Demon Deacons stalled out on downs on the ensuing drive, then Chandler took it all the way on the ensuing play.
Hartman connected with Roberson on a 14-yard touchdown on a desperate late drive to cut the deficit to three, but the Demon Deacons couldn't recover the onside kick.
For Wake Forest, this was a nightmarish repeat of last year's game, which ended with a similar final score (59-53). It didn't help that injuries in the secondary wore on the Demon Deacons as this game went on, making it tougher to slow down the Tar Heels as their offense picked up momentum.
Howell and Chandler putting up big numbers wasn't a surprise for UNC, but getting the defensive stops was a surprising positive development. The unit came up with a big interception on Hartman, got a batted-down pass from Ray Vohasek at the line on fourth down, then forced another fourth-down incompletion after Atkins' field goal.
The Demon Deacons face an even bigger matchup next Saturday with a visit from North Carolina State that does affect the division standings.
As for the Tar Heels, it will be a short week with a visit to Pittsburgh on Thursday in what will be another high-profile quarterback matchup with Kenny Pickett, who led the Panthers to a rout of Duke on Saturday.