EVANSTON, Ill. (AP) No. 3 Notre Dame looked as if it was running away with another victory, leading by 17 points early in the fourth quarter.

It turned out the Fighting Irish needed one more big dash to secure it.

Ian Book threw two touchdown passes and ran 23 yards for a score in the closing minutes to lead Notre Dame to a 31-21 victory over Northwestern on Saturday night.

The Fighting Irish (9-0, No. 4 CFP) remained in line for a playoff spot and continued to build on their best start since the 2012 team went undefeated before losing to Alabama in the BCS championship game. The Wildcats (5-4) had won four in a row to grab the Big Ten West lead and they stayed in this one when it looked like Notre Dame was ready to pull away.

Book threw a 20-yard touchdown pass to a leaping Miles Boykin in the corner of the end zone and a 47-yarder to Michael Young in the third to put the Irish ahead a 21-7. He sealed it in the closing minutes with that 23-yard run untouched up the left side, after a 17-point lead early in the fourth shrank to three.

''It's a pretty awesome feeling,'' Book said. ''It's hard to win in November. We're in such a good situation, and we know that, but I think this team does such a good job of focusing one week at a time. Everyone's excited, but everyone's just ready for Florida State (next week).''

The Irish were in a similar spot last season, only to stumble down the stretch. They were No. 3 in the first two playoff rankings en route to an 8-1 start, only to go 2-2 the rest of the way - beginning with a blowout loss to Miami.

''We didn't do a good job of just staying focused,'' linebacker Te'Von Coney said. ''We looked too far ahead and it cost us. This year, we have to stay in the moment; that's the key.''

It was 24-7 early in the fourth when Northwestern's Clayton Thorson threw a 27-yard touchdown to Riley Lees. Cameron Ruiz then blocked a punt by Tyler Newsome, giving the Wildcats possession on the Notre Dame 17. That led to a 1-yard sneak by Thorson, cutting it to 24-21 with 7:05 left.

''I could say we relaxed a little bit, but I think it was just Northwestern throwing their last punch,'' defensive end Julian Okwara said.

Either way, Notre Dame didn't get rattled.

''They've been like that all year,'' coach Brian Kelly said. ''They just play one play at a time. They don't get too high, they don't get too low. They knew in the second half they needed to play much better football, especially offensively.''

Book improved to 6-0 as the starter, going 22 of 34 for 343 yards. Chase Claypool had eight receptions for 130 yards, and Dexter Williams ran for a 1-yard touchdown in the first quarter.

The Wildcats haven't beaten a top-five opponent since 1959, when Ara Parseghian was their coach. Though they are 0-3 in nonconference games, they still lead their division.

Thorson was 16 of 29 for 141 yards and a touchdown. He also ran for two TDs. Isaiah Bowser added 93 yards rushing on 23 attempts after back-to-back 100-yard games.

''Best atmosphere I've ever played in at Ryan Field,'' right guard Tommy Doles said. ''We were really excited about this game so it's very disappointing. But all our goals are ahead of us. We set out to win the West and that's what we plan to do.''

EARLY CHANCES

Both teams missed some big scoring opportunities in the first half. The Irish were also hurt by penalties.

Northwestern blew a big chance after linebacker Blake Gallagher recovered a fumble by Book on the game's opening possession. The Wildcats took over at the Notre Dame 35, only to come away empty-handed when Charlie Kuhbander missed a 39-yard field goal wide right.

The Irish then went 79 yards, with Williams plowing in from the 1 to give them a 7-0 lead and delight the fans in blue and gold. But they also missed a big chance late in the quarter. Two penalties helped drive them back from the Northwestern 5 to the 27 before Justin Yoon's 44-yard field goal attempt sailed wide left.

Northwestern tied it midway through the second quarter when Thorson scored from the 1. Bennett Skowronek kept the drive going with a one-handed grab on fourth-and-5 at the Notre Dame 21, and the Irish's Jalen Elliott got flagged for interference breaking up a pass intended for Cameron Green in the end zone.

THE TAKEAWAY

Notre Dame: The Irish remained in the playoff hunt even though this wasn't an easy game.

Northwestern: The Wildcats hung with one of the nation's best teams, only to come up short. The loss doesn't impact the division standings.

UP NEXT

Notre Dame: Hosts Florida State on Nov. 10.

Northwestern: Visits Iowa on Nov. 10.

---

More AP college football: http://collegefootball.ap.org and http://www.twitter.com/AP-Top25

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