LAWRENCE — Twelve yards, and perhaps just one more juke, is all that kept Kansas football from one of the most improbable comeback victories in program history.

Instead, the Jayhawks left their Big 12 opener with one of the moral variety.

KU’s offense got off to a sluggish start and made a pivotal error late in the team’s 29-24 defeat to West Virginia on Saturday at David Booth Kansas Memorial Stadium. Despite that, the Jayhawks still had an opportunity to pull off what only moments earlier would’ve been seen as an improbable outcome — with no timeouts in hand, KU drove 68 yards in the game’s final 32 seconds, but sophomore running back Pooka Williams was shoved out of bounds at the West Virginia 12-yard line at the conclusion of a game-ending 40-yard play that featured multiple laterals.

“If we had about 15 more yards on that play,” KU coach Les Miles said, “we’d have just been celebrating like heck. ...

“Including the last play, I felt like we were going to win. If we could’ve made a little different cut on the back end of that play, we may have.”

That the Jayhawks (2-2, 0-1 Big 12) were even in the game at the finish is a testament to both the defense’s overall performance and the offense’s resiliency to bounce back from a flat opening half.

KU entered the break trailing 10-7 with 125 yards of total offense, the latter a far cry from the 567 total yards piled up in last Friday’s 48-24 upset victory at Boston College. Kwamie Lassiter’s 28-yard catch-and-run touchdown produced the only points of the half for the Jayhawks, which averaged 3.1 yards per carry across the opening two quarters. The Mountaineers (3-1, 1-0) scored on a 3-yard touchdown run from Kennedy McKoy on their first drive of the game and doinked a 37-yard field goal off the upright but through in the final seconds to give the game its margin at the intermission.

WVU added to its lead with relative ease on its first drive of the second half, with Martell Pettaway shaking off tacklers on a 23-yard carry to pay dirt. KU began to chip away, however, with Liam Jones connecting on a 23-yard field goal at the end of a long drive aided by several hard-nosed runs by quarterback Carter Stanley.

That’s when KU, trailing 17-10, attempted and appeared to successfully recover an onside kick. The moment became a game-changer in the other direction, though, as officials ruled recovering player Jamahl Horne committed a kick catching interference penalty — freshman Jacob Borcila’s kickoff never bounced off the turf, a requirement before any contact is made.

After the ruling, Miles needed a lengthy explanation from three officials.

“The only thing I would tell you is," Miles said, “if they want to eliminate an exciting play from college football, they need to come up with a rule and just ban a play, OK?”

WVU capitalized on the new possession and the 15-yard penalty on Horne, with kicker Evan Staley booting through a 44-yard attempt to push the advantage to 20-10 with 4:20 left in the third quarter.

KU needed just one play to respond. Stanley found junior wide receiver Andrew Parchment streaking down the middle on a 75-yard touchdown connection on its first play of the ensuing drive to cut the deficit to three points. WVU countered with another Staley kick, this time from 22 yards out, to make the score 23-17 with 12:35 to play.

Stanley and KU then made the game’s most costly mistake. Attempting to find tight end Jack Luavasa up the sideline, Stanley slightly underthrew the ball. WVU cornerback Keith Washington flashed concentration and athleticism by batting the ball in the air then securing it for an interception at midfield. The Mountaineers bled clock and eventually cashed in, with Pettaway scoring his second touchdown on a 7-yard run up the middle that after a failed two-point conversion settled the score at 29-17 with just 5:04 remaining.

“Had our tight end coming across the field and I just left it six inches short,” Stanley said of the interception. “If that goes six inches above (Washington’s) hand, (Luavasa) is catching that, going down the sideline for who knows how many yards. It’s tough. It hurt. But again, we had to flush it and try to come back and win the game.”

The Jayhawks did just that.

KU showed urgency on its next drive, with Stanley again finding Parchment for a 3-yard connection that capped a 10-play, 70-yard march down the field with 2:10 to play. But an onside kick attempt went out of bounds, and while the KU defense forced a punt that delivered the ball back to the offense with 32 seconds remaining, a Daylon Charlot reception that turned into laterals to Parchment and Williams ended when Williams was pushed out of bounds at the WVU 12 with the clock at zeroes.

Safety Mike Lee said he’d never seen that trick play from the Jayhawk offense at practice.

“It looked good. They was getting down the field, tossing the ball back,” Lee said. “If Pooka would’ve never went out of bounds, I think he would’ve scored that, because he’s a good back, a good player. That was a good play, but I wish we could’ve got it.”

Stanley finished the contest 19-for-25 for 275 yards, three touchdowns, an interception and a lost fumble. Williams led the KU running backs with 76 rushing yards on 15 attempts, while Parchment's five catches for 132 yards and a pair of touchdowns paced the Jayhawk receivers.

KU actually outgained WVU in total offense, tallying 417 yards to the visitor’s 394.

“It kind of lets you know that we can be productive and we are productive and we’ll fight you ’til the end,” Miles said of his offense’s second-half showing. “But we’ve got to be better, and frankly you hate to give away opportunities at victory."

As KU players left the field, many in the announced crowd of 35,816 gave the team a standing ovation, a bit of an oddity for a losing squad but perhaps a gesture in appreciation of the progress shown across the last two weeks.

Miles struck a similar tone in his postgame message in the locker room.

“I told them they worked hard and that they’re going to be something special,” Miles said, “and they still have a great opportunity to be that.”