CHARLOTTESVILLE, Va. (AP) — Drake Maye threw for two touchdowns and ran for another and No. 17 North Carolina outscored Virginia 21-7 after halftime to rally for a 31-28 victory Saturday.

Elijah Green scored twice and Josh Downs caught 15 passes, including a touchdown, for the Tar Heels (8-1, 5-0 Atlantic Coast Conference, No. 17 CFP), now 5-0 in league play for the first time since 2015, when they qualified for their lone appearance in the ACC championship.

The Cavaliers (3-6, 1-5), playing without three starting wide receivers, lost for the fifth time in six games and need to win their final three games to qualify for a bowl game.

Virginia started fast, getting a touchdown on its opening drive for the first time this season and led 14-10 at halftime. But Maye led the Tar Heels downfield in just 2:55 to start the third quarter, Green finishing the drive with a 4-yard run. Virginia answered with a 75-yard touchdown drive of its own to retake the lead, but Maye found Downs from 19 yards before the quarter was over and hit Green with a 22-yard pass in the flat with 13:19 left.

Brennan Armstrong pulled Virginia within a field goal with his second scoring run with 3:24 left on a drive that covered 71 yards in just 59 seconds, but Virginia was offsides on the ensuing onside kick, giving UNC the ball at the Cavaliers 23. One more completion to a diving Downs converting a third-and-2 allowed the Tar Heels to run out the clock.

Maye finished 26 for 37 for 293 yards and ran for 74 yards. Downs’ catches went for 166 yards, giving him 23 catches for 369 yards and three TDs in the last two years against Virginia.

Xavier Brown and Ronnie Walker ran for Virginia scores.

THE TAKEAWAY

North Carolina: Maye has frustrated teams with his prolific passing, but especially frustrated ACC tackles leader Nick Jackson on a second-quarter scramble from the Virginia 5. Rolling right and looking for a receiver, Maye instead found Jackson closing in and reversed course and scrambled all the way accross the field for the touchdown.

Virginia: The Cavaliers tried a surprise punt on a fourth-and-5 play from the Tar Heels’ 32 in the second quarter, but while Armstrong appeared to be trying to kick it out of bounds, it bounced into the end zone for a touchback and a net gain of just 12 yards. North Carolina then drove 80 yards in 13 plays to take a 10-7 lead.

UP NEXT

The Tar Heels are back on the road to face No. 20 Wake Forest.

Virginia stays at home for its third of four consecutive home games, taking on Pittsburgh.