Virginia beat North Carolina 38-31 Saturday night in a close battle at Kenan Stadium in Chapel Hill, N.C. The Cavaliers (6-3, 4-2 ACC) used an offensive explosion to outlast the Tar Heels (4-5, 3-3 ACC). Virginia had 517 yards of total offense in the game, the highest total of the season. Senior quarterback Bryce Perkins was responsible for 490 of the 517 yards and also scored all of the Cavaliers’ five touchdowns. 490 yards was a career-high for Perkins and set a school record. With the win, Virginia is bowl eligible for the third consecutive season and is in the driver’s seat of the ACC Coastal, controlling its destiny the rest of the season. North Carolina scored first with a field goal, but Virginia responded with a 70-yard touchdown drive that ended with a one-yard run by Perkins for the score. The teams traded blows for the rest of the half. Perkins led the Cavaliers on another touchdown drive right before the break to tie the score at 17 going into the half. Senior wide receiver Hasise Dubois caught the pass to bring Virginia even. Dubois — who has had over 90 yards receiving in four of his last five games — finished with 6 receptions for 97 yards. Virginia came out of the break with some momentum. The Cavaliers started with the ball and seized control of the game as Perkins exploded for a 65-yard touchdown run to put Virginia up 24-17. The Cavaliers extended their lead to 31-17 the next drive, as senior tight end Tanner Cowley recorded his first career touchdown catch. Junior wide receiver Terrell Jana made a crucial catch to extend the drive. He picked up 34 yards for Virginia as the Cavaliers faced 3rd and 11 from their own 14 yard line. Jana, who broke the rock, finished with a career-high 13 receptions for 146 yards. The Tar Heels, however, didn’t fade away easily. Freshman quarterback Sam Howell — who finished with 353 yards passing and four touchdowns — cut Virginia’s lead to seven with a 50-yard touchdown strike. But Perkins could not be stopped. Virginia went up 38-24 on a Perkins touchdown pass, and although Howell struck back with another touchdown pass the subsequent drive, it was not enough. Both defenses came up with stops in the fourth quarter, and the 38-31 scoreline didn’t change. The Cavaliers — losers of two consecutive away conference games — ended their road woes against the Tar Heels and picked up a crucial conference win. Virginia’s stretch of ACC play continues Saturday against Georgia Tech at home. Kickoff is set for 12:30 p.m.