DURHAM, N.C. -- T.J. Yates threw for 264 yards and a touchdown, and North Carolina continued its dominance of Duke by holding off the Blue Devils 24-19 on Saturday.

Anthony Elzy rushed for a career-high 116 yards, and he and Shaun Draughn each had short scoring runs for the Tar Heels (7-5, 4-4 Atlantic Coast Conference), who led 24-10 late before Duke (3-9, 1-7) made things interesting in the final 5 minutes.

They stuffed Draughn in the end zone for a safety, pulled within five on Brandon Connette's 2-yard touchdown run with 3:20 left, and forced a punt to get the ball back with 43 seconds left at the Duke 24. But they couldn't come up with a miracle finish.

Austin Kelly caught Sean Renfree's last pass near midfield, but he was wrapped up as time expired before he could find someone to take a lateral. That sealed North Carolina's 20th win in 21 meetings with Duke.

Renfree was 24 of 39 for 242 yards with two interceptions and a 9-yard touchdown pass to Kelly for Duke, which ended its season with a three-game losing streak.

Yates was 28 of 35, reached the 9,000-yard passing mark for his career and threw a 5-yard touchdown pass to Joshua Adams for the Tar Heels, who had four scoring drives of at least 80 yards and converted 65 percent of their third downs. They snapped a two-game losing streak and locked up their third straight winning season.

Elzy scored on a 5-yard run and surpassed the previous high of 95 yards he set three years ago against Miami. He helped North Carolina keep hold of the Victory Bell traveling trophy that goes to the winner of this game.

The Tar Heels have won seven straight in the rivalry between schools located 8 miles apart, and they rolled up 519 total yards against the ACC's worst defense. Duke entered ranked last in the league by allowing averages of 204 yards rushing, 240 yards passing and 444 total yards, and only Wake Forest (38) is giving up more points per game than the Blue Devils (36.5).

Yates became the first North Carolina quarterback to reach 9,000 yards passing for his career with a 14-yard toss to a diving Adams early in the second quarter.

He later put the Tar Heels up 17-7 on their first possession after halftime, completing five consecutive passes during the 12-play, 80-yard drive that ended with his touchdown toss about 5 minutes into the half.

Will Snyderwine's 21-yard field goal pulled the Blue Devils to 17-10 before Yates led the Tar Heels 81 yards in 12 plays. His 35-yard strike to Dwight Jones on a third-and-8 set up Draughn's 3-yard TD run that made it 24-10 with 11 1/2 minutes left and prematurely sent some fans to the exits.

Jones finished with 11 catches for 121 yards for North Carolina, while Yates was nearly perfect in the first half, completing 14 of 16 passes for 158 yards and leading a pair of long scoring drives. The Tar Heels scored on drives of 10 plays and 94 yards, and 16 plays and 87 yards.

Duke's only points of the first half came Renfree's short scoring pass to Kelly that put the Blue Devils up 7-0 with 6:19 left in the first quarter.