CHAPEL HILL, N.C. (AP) Ryan Willis and Virginia Tech's offense struggled to sustain drives much of Saturday night at North Carolina, while the Hokies' traditionally tough defense kept surrendering big chunks of yardage.

And yet, the Hokies hung in - then pounced when they got a chance to snatch the game away.

Willis threw the go-ahead 1-yard touchdown to Dalton Keene with 19 seconds to help Virginia Tech beat UNC 22-19, capping a game-defining final 6 1/2 minutes that kept the Hokies unbeaten in the Atlantic Coast Conference.

The Hokies (4-2, 3-0 ACC) were on the verge of going down two scores with about 6 minutes left when they forced UNC tailback Michael Carter into a fumble as he neared the goal line. And that opened the door for Willis, who directed an 18-play, 98-yard drive for the win.

''That last drive,'' Keene said, ''was really incredible.''

Indeed. Just about everything was for the Hokies in those final 6 1/2 minutes.

Virginia Tech converted four third downs along with a fourth-and-9 that saw Willis escape a collapsing pocket and run to keep the drive alive.

''We just needed to get our first first down, get the chains moving,'' Willis said.

Meanwhile, the Tar Heels (1-4, 1-2) outgained the Hokies 522-375 yet committed a dizzying array of mistakes that all but gave the game away.

Carter's fumble stood out, but there was also a dropped wide-open deep ball by Dazz Newsome for what should've been an 85-yard second-quarter score and Nathan Elliott missing a completely-alone Anthony Ratliff-Williams with a bad throw on what should've been a 17-yard TD in the third.

''Give them the credit, they made the plays when they had to and they got it done,'' UNC coach Larry Fedora said, adding: ''We just didn't make enough plays to win the football game. And we had a lot of opportunities.''

THE TAKEAWAY

Virginia Tech: The Hokies continued trends of playing well on the road in the league and regrouping after a loss. Virginia Tech improved to 8-3 in ACC road games under Justin Fuente as well as 9-1 in the game following a loss. And Willis sure came up big in directing the final drive, including throwing a 2-point conversion pass to Damon Hazelton.

Asked about the toughest play of the drive, Willis said: ''I don't know. I'm kind of excited, kind of amped up right now.''

UNC: This has the potential to be a crushing loss. A touchdown from Carter (who had a huge running day with 165 yards on 18 carries) would've had them poised for a second league win after losing by 52 points in last year's meeting. Yet the defense that had ranged from good to terrific all night couldn't get a final stop, and that only piled on to an offense that repeatedly settled for field goals and left points on the field.

''I want it bad for them, I really do,'' Fedora said. ''I just want to make sure they know how close they are.''

THE HIT

The Tar Heels had gotten themselves out of trouble when Elliott connected with Carl Tucker for an 80-yard catch and run - the longest reception ever by a UNC tight end - and eventually had a first-and-goal from the 1. Carter took the handoff but took a hard hit from Tyree Rodgers that sent the ball shooting straight up in the air.

''I saw that thing squirt up in the air,'' Hokies defensive coordinator Bud Foster said. ''I was just hoping he didn't cross the goal line, you know?''

Virginia Tech's Jovonn Quillen recovered the fumble to set up the final drive.

''I wasn't low enough,'' Carter said. ''He was lower than me. In football basically the lower man wins.''

LINEUP CHANGES

UNC started true freshman Cade Fortin at quarterback in search of a spark, though he left before halftime with an apparent right leg injury. The Tar Heels also got a waiver for defensive lineman Malik Carney to delay the final game of his suspension for selling team-issued shoes because two other linemates weren't available.

UP NEXT

Virginia Tech: The Hokies have an open weekend before hosting Georgia Tech on Oct. 25 in a Thursday night game.

UNC: The Tar Heels visit Syracuse next Saturday in a cross-divisional league game, which marks the first meeting between the schools since 2003.

---

More AP college football: http://apnews.com/tag/collegefootball and http://www.twitter.com/AP-Top25

---

Follow Aaron Beard on Twitter at http://www.twitter.com/aaronbeardap

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.