LAWRENCE — Dramatic at the climax, Les Miles’ debut as Kansas football head coach was not unlike one of his ventures into Hollywood.

Considering how this script has too often gone for recent Jayhawk squads, however, Saturday’s thrilling finish featured a twist worthy of M. Night Shyamalan.

KU blew a 13-point fourth-quarter lead, then engineered an out-of-nowhere response on its last offensive drive to retake the lead in the final minutes and hold on for a 24-17 victory over Indiana State at David Booth Kansas Memorial Stadium. With the win, the Jayhawks avoided what would’ve been a fourth defeat to an FCS-level opponent in the last decade.

Trailing 17-16 with 4:24 remaining, the KU offense clicked for the first time all day. Senior starting quarterback Carter Stanley, who handled every snap for the Jayhawks, rode long completion after long completion to wide receivers Andrew Parchment and Daylon Charlot, with the latter hauling in a go-ahead 22-yard score and the former chucking a two-point conversion on a trick play with 2:04 remaining to hand KU its eventual winning margin.

Miles, the national championship-winning former head coach at LSU who joined the beleaguered Jayhawk program this offseason after a two-year hiatus from the sport, got his feel-good ending — for the season-opener, at least.

“I’m excited, I can tell you that right now,” Miles said. “I just told (the players): There’s a lot of games I’ve been fortunate to be a part of where we finished first in that game, (but) I don’t know that I’ve enjoyed a group of men and a team and their effort any more than the one I enjoyed right here today.”

It wasn’t easy.

The Jayhawks (1-0) rode a 57-yard interception return for a touchdown by senior cornerback Hasan Defense to the only score of the opening half and a 10-3 advantage at the break. The KU defense shined from the outset, a trend that continued on senior safety Jeremiah McCullough’s goal-line interception of quarterback Ryan Boyle on the Sycamores’ first drive of the second half.

Defense and McCullough’s interceptions, much-needed on an afternoon where the offense lost three fumbles, continued a pace set by last year’s defense — KU finished third nationally with 2.4 takeaways per game.

“When you win games, those plays are made by people who cannot wait to be put in that position and have always thought that they would be the one to make that play,” Miles said. “Yeah, there weren’t two more exciting plays in the game.”

McCullough’s pick set up KU’s first offensive touchdown of the season, with Stanley connecting on a 10-yard third-down strike to tight end James Sosinski for the former Jayhawk basketball walk-on’s first career score. Liam Jones, who was off on a 49-yard field goal attempt earlier, missed the extra point to keep the advantage at 16-3.

The Sycamores (0-1) didn’t roll over, though.

After recovering a Stanley fumble on a fourth-and-2 attempt from the Indiana State 21, they orchestrated a 14-play, 77-yard scoring drive, with Boyle hitting Dante Jones in stride for a 26-yard touchdown on a fourth-and-8 play early in the fourth quarter. Then, after punting the ball deep into Jayhawk territory, Indiana State’s Kaleb Brewer strip-sacked Stanley near the goal line, delivering an easy touchdown to teammate Inoke Moala and a 17-16 lead for the visiting squad with 4:24 left.

But Stanley wasn’t fazed by the blunder, and neither were Parchment and Charlot. The receiving duo hauled in a pair of passes apiece for 68 combined yards on the game-winning drive, with Parchment’s 11-yard third-down conversion — the junior college transfer juked a defender on the play to move the sticks — coming one play before Charlot’s leaping touchdown grab in the back of the end zone.

Indiana State couldn’t convert a fourth-and-2 from its own 33 on the ensuing drive, and the celebration was both on the sideline and among the announced crowd of 32,611.

“I think we’ll learn to win games like this,” Miles said, “without as much drama.”

Soon after the final whistle, “New York, New York” by Frank Sinatra began playing over the stadium loudspeakers — a perhaps out-of-place choice on its surface but a new tradition Miles later justified.

“I went there several years ago with my family and I would stop and get an orange juice at a deli, right? It’s the best orange juice I ever had, OK? Went over to another place, got a sandwich. It’s the best sandwich I ever had,” Miles said. “So basically for me, it told me that if you’re going to have success in a place like New York, you’d better raise your game and compete, OK? So I’ve kind of enjoyed that song because kind of what’s unsaid.”

Stanley, who started over junior Thomas MacVittie, finished 20-for-29 for 241 yards and a pair of touchdown passes, and Miles revealed the senior will draw a second straight start when KU returns to action for a 6 p.m. Saturday home tilt against Coastal Carolina. Parchment had eight catches for 121 yards in his Jayhawk debut, while his roommate Charlot hauled in six receptions for 79 yards and the decisive touchdown.

Miles said he was most encouraged by how a team without experience winning these sort of down-to-the-wire contests managed to do just that — last year’s eventual 3-9 squad dropped its opener, a 26-23 overtime defeat to FCS opponent Nicholls State.

“It’s a start. It’s the start,” Miles said. “It allows us to step to another opponent and play hard and recognize that if we get in the back end of a game, we can win.”

In recent weeks, athletic director Jeff Long has sensed from the players a heightened belief in themselves and their ability to come back from a gut-punch moment like the one suffered late Saturday.

“I think they had the belief, but then you’ve got to go do it. You don’t know if they’re going to do it until they do it, right?" Long said. "So I was thrilled for ’em, happy for ’em, and I think as Coach said, this is really something to build off of.”

With an eye to the future, Miles said victories like these, with contribution across the board, are ones a coaching staff “can sculpt a team on.”

“We’re just getting started,” Miles said. “This Jayhawk team is going to play big, big games. There’s going to be significant games later on, mid-November area.”