Bob Donnan-USA TODAY Sports

Quarterback Drake Maye ran 13 yards for a touchdown in the second overtime and No. 17 North Carolina's defense made it stand up in a 40-34 victory against visiting Appalachian State on Saturday in Chapel Hill, N.C.

Omarion Hampton's third touchdown run in the first overtime helped the Tar Heels extend the game. He ended up with 234 rushing yards on 26 carries.

Maye threw for 208 yards on 21-for-30 passing.

North Carolina's Ryan Coe, who made two earlier field goals, missed from 39 yards on the final play of regulation, sending the game into OT.

That came after Michael Hughes of Appalachian State booted a 33-yard field goal with 1:22 remaining to tie the game at 27-27.

Hampton's 7-yard touchdown run gave the Tar Heels the lead with 9:19 to play in a rainy fourth quarter.

Nate Noel's 7-yard run with 10:44 remaining gave the Mountaineers the lead. He also scored the first touchdown in overtime.

Appalachian State quarterback Joey Aguilar was 22-for-43 for 275 yards.

Aguilar threw 33 yards to Dashaun Davis for a go-ahead touchdown on the first series of the second half.

It was even again after Caleb Hood's 5-yard touchdown run. Coe's 31-yard field goal later in the third quarter put North Carolina up 20-17.

Hampton's workload was heightened because British Brooks, who gained 103 yards against South Carolina last week, was out with an injury.

Both teams threatened on their first possession. North Carolina was stopped on a fourth-and-1 play from the Appalachian State 13, while the Mountaineers came up empty when Hughes' field goal attempt from 47 yards was wide left.

The next time Appalachian State had the ball, Hughes booted a career-long 46-yard field goal. That capped a 19-play drive that included a fourth-and-2 conversion.

Two snaps later, Hampton burst 68 yards for a touchdown. It was the longest rush of the sophomore's career.

The Mountaineers drove 75 yards in nine plays for a touchdown on Aguilar's 5-yard toss to Eli Wilson. Then the Tar Heels used nine plays to get into position for Coe's 47-yard field goal.

More must-reads:

TODAY'S BEST
Ryan Blaney staves off challengers for dominant win at Iowa Corn 350
Watch: UFL championship marred by late on-field altercation between Stallions, Brahmas
Watch: Bryson DeChambeau pays tribute to the late Payne Stewart after winning U.S. Open
Bryson DeChambeau prevails in dramatic final round battle to win U.S. Open
Dodgers star will miss 'some time' with broken bone in left wrist
Former MLB journeyman dies at 61 years old
Rory McIlroy chokes away U.S. Open with pair of brutal missed putts
Pivotal Celtics center deemed questionable ahead of Game 5
Draymond Green weighs in on Klay Thompson's latest move
Tom Brady makes his broadcasting debut during UFL championship
Former top-five pick could follow the Dante Exum blueprint for NBA return
Yankees shelve top prospect once more due to injury concern
Sky forward Angel Reese rips officials following loss to Fever
Watch: Reds' Elly De La Cruz scores from second base on pickoff attempt
Dodgers' Dave Roberts confirms Yoshinobu Yamamoto is going on 15-day IL
Watch: Fighter jet flyover briefly interrupts Orioles at-bat
Rangers designate right-hander for assignment
Watch: Denmark's Christian Eriksen nets goal at Euro 2024 three years after suffering cardiac arrest
Giants place left-hander on 15-day IL with ankle sprain
Oilers crush Panthers in Game 4, stay alive in Stanley Cup Final