Miami(8-0, 6-0) had a 7-0 lead at 8:33 of the first quarter. Quarterback Darian Mensah tossed a two-yard touchdown pass to wide receiver Malachi Toney.
North Carolina(4-4, 2-3) tied it up 7-7 at the 11:50 mark of the second quarter. Quarterback Billy Edwards Jr. tossed an eight-yard pass to tight end Jelani Thurman.
The Canes regained the lead 14-7 with 7:41 left in the second. Mensah connected a 31-yard swing pass to running back Mark Fletcher Jr. on the right sideline for a touchdown.
The Tar Heels evened it up 14-14 with 1:56 to go in the quarter. Thurman was found by Edwards again on another eight-yard pass play.
The Hurricanes would go ahead 17-14 with 22 seconds left in the first half. Jake Weinberg kicked a 26-yard field goal.
North Carolina got their first lead of the game 21-17 at the 10:51 mark of the third quarter.
Edwards fired a 16-yard touchdown pass to wide receiver Jordan Shipp in the back right corner of the end zone.
The U moved in front 24-21 with 5:14 remaining in the third. Fletcher rushed up the middle on a two-yard touchdown run.
In the fourth quarter, UNC reclaimed the lead 28-24 at 11:46. Running back Demon June scored on a run through the middle of the offensive line from one yard away.
The Hurricanes leaped to a 31-28 advantage at the 7:49 mark. Fletcher changed in by bulldozing from two yards out up the middle on a rushing attempt.
Miami extended their lead to 38-28 with 2:33 left in the fourth on their next possession. Mensah angled a nine-yard touchdown pass to Toney on the right hash marks.
North Carolina closed it to 38-35 with 1:38 remaining in the contest. Edwards sent a 15-yard touchdown pass to wide receiver Trech Kekahuna.