AUBURN, Ala. (AP) -- Auburn didn't win it with talent, style or grace.
"We gutted it out. That was a gut win," Tigers coach Tommy Tuberville said.
Brandon Cox threw a touchdown pass to Gabe McKenzie with 2:01 remaining and Antonio Coleman returned a fumble for a score moments later to give No. 18 Auburn a 23-13 win over Kansas State on Saturday night.
Auburn players jumped around like they'd won the national championship after the game, and coach Tommy Tuberville was hopeful the come-from-behind win would pay dividends later in the season.
Auburn's offense struggled all night, and Kansas State seemed poised for its 18th straight season-opening win, the first against a ranked opponent on the road.
But Auburn finally wore down the Wildcats. Cox -- who spent most of the game on his back or trying to escape pressure -- found McKenzie alone in the left corner of the end zone from the 3 to cap a 57-yard, seven-play drive.
"Everybody was fired up," Cox said. "We were going to do whatever we had to do to get in the end zone."
The Wildcats got the ball back but Quentin Groves sacked Josh Freeman, forcing a fumble that Coleman returned 34 yards for a touchdown.
Freeman completed 32 of 57 passes for 268 yards and was intercepted twice, including on Kansas State's final possession after Coleman's fumble return.
Kansas State players were stunned afterward. As Auburn fans went wild in a stadium that was nearly all orange, the Wildcats gathered in a tight group in front of their bench and walked off the field in formation. A few thousand fans dressed in purple cheered.
K-State coach Ron Prince said his team "just didn't get it done."
"You would like to be able for the kids to go away and know that they can play with Auburn. You don't come to a place like this and expect them to give you the game. You have to take it," he said.
They nearly did.
With the Wildcats trailing 6-3 after a first half dominated by defense, Kansas State's Marcus Watts intercepted Cox at the Wildcats 31 on the first play of the third quarter. Freeman directed the offense to the Auburn 21, and it was time for a trick.
Freeman took the snap and turned left, tossing a lateral to wide receiver Jordy Nelson on a third-and-6 play. Nelson heaved the ball deep to Leon Patton, who was all alone in the right side of the end zone for the first touchdown of the game.
Kansas State's Brooks Rossman kicked field goals from 20 and 40 yards, but he missed from 47 yards.
Auburn freshman Wes Byrum also had field goals of 20 and 31 yards.
Auburn only returned one starter on the offensive line, and it showed. Cox was sacked five times -- four times in the first half -- and spent most of the game trying to escape Wildcats defenders coming at him from all directions.
Cox was 17-of-30 passing with two interceptions for 229 yards.
Kansas State held Auburn to only 62 yards rushing. The Tigers weren't helped by the suspension of Brad Lester, who led Auburn runners last season but was held out for unspecified academic problems.
Auburn's Ben Tate ran for 82 yards.
The coronavirus and college sports: NCAA reopening plans, latest news, program cuts, more
Two Power 5 conferences -- the Big Ten and Pac-12 -- already have postponed fall sports, including college football. Will the SEC, ACC and Big 12 attempt to play? Here's the latest on how the coronavirus pandemic is affecting the college sports world.
Notre Dame says 2 football players recently tested positive for COVID-19
Notre Dame tested 117 football players for COVID-19 on Monday and two tested positive, according to university physician Dr. Matt Leiszler.
Clemson's Dabo Swinney says fewer teams doesn't hurt value of title
Clemson's Dabo Swinney said the absence of two of the five power conferences will not diminish the meaning of winning a national title, saying, "Whoever wins it, wins it. That's the champ."
NCAA Division I Council recommends eligibility extensions due to coronavirus pandemic
The NCAA Division I Council is recommending additional eligibility for student-athletes impacted by the coronavirus pandemic and might decide to push forward additional protections, it said Wednesday.
Sportsbooks halt college football betting as season remains in flux
With the Big Ten and Pac-12 postponing their seasons due to the coronavirus pandemic, sportsbooks across the U.S. have halted betting on college football.
Bob Bowlsby: Big 12's comfort proceeding with football based on medical professionals
Big 12 commissioner Bob Bowlsby said Wednesday that the conference is comfortable moving ahead with plans to hold its football season this fall because its medical professionals haven't indicated it's unsafe to do so.