NASHVILLE, Tenn. (AP) Vanderbilt coach Derek Mason took a timeout before Kansas State lined up for fourth-and-8 just 19 yards away from the tying touchdown.

Then he watched as linebacker Oren Burks and safety LaDarius Wiley tackled quarterback Jesse Ertz just shy of a first down, sealing a 14-7 upset of No. 18 Kansas State on Saturday night.

''I threw my hand up and said, `Thank you Jesus,''' Mason said.

Kyle Shurmur scored on a 2-yard run with 8:23 left, and Vanderbilt notched its first victory over a ranked, nonconference opponent since North Carolina State in 1946.

Vanderbilt improved to 3-0 for the first time since 2011. The Commodores also have won five straight at home, which now includes back-to-back upsets of Top 25 opponents including a victory over then-No. 24 Tennessee in the 2016 regular-season finale.

''We're trying to get all these monkeys off our back,'' Mason said.

Kansas State (2-1) last beat a Southeastern Conference team on the road in the regular season in 1982 at Kentucky.

D.J. Reed of the Wildcats had not one, but two touchdowns wiped out. He picked up a fumble by Shurmur and ran 35 yards to the end zone in the second quarter. Replay review ruled Shurmur was down before the ball came out. In the final seconds of the third quarter, Reed returned a punt for a TD that was wiped out by an illegal block in the back.

Kansas State coach Bill Snyder said the Wildcats aren't playing with the discipline needed.

''Not just the two that called back touchdowns, but there were some other penalties that were very costly,'' Snyder said. ''It doesn't mean your guys aren't playing hard, but it means that we're not playing with the kind of discipline and focus that we need to.''

Those weren't the only points Kansas State missed. Matthew McCrane's 42-yard field goal late in the third quarter went just wide right.

Shurmur drove the Commodores 84 yards using up half of the first quarter to put Vanderbilt up 7-0 with a 2-yard pass to C.J. Duncan.

Ertz answered for Kansas State with a 75-yard drive, and on fourth-and-1, Ertz took the ball wide left and ran 15 untouched for a TD.

Wiley intercepted a pass tipped by Joejuan Williams early in the fourth quarter, putting the Commodores at the Kansas State 39 off the first interception of Ertz this season. Vanderbilt had first-and-10 at the 11 when Ralph Webb, the Commodores' career rushing leader, fumbled, and linebacker Elijah Sullivan recovered it with 11:20 left.

Ryan White picked off Ertz's pass soon after at the Wildcats 33, and Vanderbilt needed only four plays before Shurmur scored the clinching TD after having to pick up the ball off the ground after the snap. Shurmur said he didn't want to make a bad play worse.

''Just trying to get all I could and maybe score I guess,'' Shurmur said.

THE TAKEAWAY

Kansas State: Ertz ran early and often for the Wildcats, piling up 81 yards on his first seven carries. But the Commodores made an adjustment, and he finished with 126 yards on 24 carries. Vanderbilt also kept the dual-threat quarterback from hurting it through the air, holding him to 76 yards and sacking him twice.

It was the fewest points scored by Kansas State since being held to seven by Oklahoma in 2015.

''We had our fair share of errors, and that's not going to get you a win,'' Ertz said.

Vanderbilt: The Commodores now have allowed only 13 points this season, and they smothered an offense that scored 55 points in each of its first two games.

''Our defense played lights' out and really relieved some pressure on the offense,'' Shurmur said.

POLL IMPLICATIONS

The Wildcats might not fall out of the rankings with No. 23 Tennessee and No. 25 UCLA both losing. This win might be enough for Vanderbilt to be ranked for the first time in coach Derek Mason's tenure.

UP NEXT

Kansas State: Hosts Baylor on Sept. 30.

Vanderbilt: Hosts top-ranked Alabama.

---

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

---

Follow Teresa M. Walker at www.twitter.com/teresamwalker

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