CHAPEL HILL, N.C. – Ian Book kept scrambling to buy time and help No. 2 Notre Dame put together multiple long touchdown drives. The Fighting Irish defense allowed little room for Sam Howell and No. 19 North Carolina's potent offense to do the same.

Book threw for a score while Notre Dame locked down the Tar Heels offense for the final three quarters in a 31-17 victory on Friday. The victory kept Notre Dame on course to earn a spot in the Atlantic Coast Conference championship game.

Both teams scored two first-quarter touchdowns and went into halftime tied at 17-17, only to see Notre Dame gradually take over in a performance coach Brian Kelly called "one of those road wins that really shows the mettle of your football team."

"It felt like it was going to be a shootout in the beginning," said Book, adding: "Our defense did an unbelievable job in the second half and gave us a lot of opportunities, and we were able to capitalize on it."

Book threw for 279 yards and ran for 48 for the Fighting Irish (9-0, 8-0 ACC, No. 2 AP poll), using his mobility and elusiveness to keep plays alive on a night when both offenses frequently faced long fields.

Receiver Ben Skowronek got Notre Dame its first lead with his 13-yard run around the right side midway through the third quarter. Kyren Williams ran for 124 yards — including a 47-yarder with about 5½ minutes left as the Irish burned clock.

Williams closed that drive with his second rushing TD, a clinching 1-yarder with 1 minute, 20 seconds left. He also had a 4-yard scoring catch in the first quarter after Book corralled a low snap and scrambled to buy time before finding him on the right side.

More impressive, though, was a defensive effort that forced Howell and the Tar Heels to work for every gain after the opening quarter.

UNC (6-3, 6-3, No. 25 CFP) sprinted to touchdowns on its first two drives, but Notre Dame surrendered only one field goal from there. The Tar Heels came in averaging 43 points and 563 yards, yet they were unable to protect Howell nor open running lanes for a pair of backs averaging better than 100 yards rushing each in Javonte Williams and Michael Carter.

The Tar Heels finished with a season-low 298 yards.

"You can't rush for 87 yards and have six sacks and beat anybody, much less a really, really good football team," UNC coach Mack Brown said. "So give Notre Dame credit. They're really, really good."