Program history proved oh-so-close — yet once again just out of reach — for Kansas football on Saturday.

Iowa State quarterback Brock Purdy’s fourth passing touchdown was a dagger, the sophomore side-stepping Jayhawk linebacker Azur Kamar to deliver a 4-yard scoring strike to Sean Shaw on a fourth-and-goal play with 1:04 remaining. The do-or-die decision from ISU head coach Matt Campbell paid off in delivering the game its final margin, 41-31 in favor of the Cyclones (No. 22 in the College Football Playoff rankings) at Jack Trice Stadium in Ames, Iowa.

KU, which rallied from a 12-point hole in the third quarter to twice take the lead, allowed the ISU offense to score touchdowns on its final three drives.

“One that we let it get away,” said KU head coach Les Miles. “When we look at the film we’ll look at the opportunities we had to win it. Those would be the key pieces to me.”

The outcome ensured no Big 12 road victories this decade for the Jayhawks, whose conference futility streak away from home reached 52 total games. Forty-nine of those came in true road environments, including a last-second 50-48 loss earlier this season at Texas.

KU’s last league win away from home came in Ames, a 35-33 triumph on Oct. 4, 2008.

“They played their hearts out,” Miles said of his players in a postgame radio interview. “They’re a quality group of young men. Enjoyed coaching them. They’ll live to fight for one more victory this year.”

KU (3-7, 1-8 Big 12) never played like the 26-point underdog oddsmakers had pegged them as.

Trailing 21-9 in the final few minutes of the third quarter, senior quarterback Carter Stanley found running back Pooka Williams for a 27-yard scoring connection down the middle of the field, the sophomore streaking past a linebacker for KU’s first touchdown. That 10-play, 62-yard drive was set up by a turnover on downs, with Jayhawk defenders Davon Ferguson and Gavin Potter tackling ISU running back Breece Hall for no gain on a fourth-and-1 attempt.

Purdy’s first pass of the Cyclones’ ensuing drive was tipped by linebacker Jay Dineen and intercepted by safety Mike Lee, who set his offense up at the ISU 38 with what was only the seventh takeaway by the KU defense this season.

“It gave us the opportunity to go down there and win the game, and that’s exactly what we did,” Miles said of Lee’s interception. “Got hot at quarterback, who I see as a guy that when he gets hot, you want to play to his hand, and that’s what I did.”

Stanley capitalized just four plays after Lee's pick, finding fullback Spencer Roe for a 2-yard touchdown and wideout Andrew Parchment for the two-point conversion and a 24-21 advantage.

That’s when the wheels fell off for the KU defense.

Purdy hit Hall for a 24-yard touchdown pass to cap a four-play, 57-yard drive, and while the Jayhawks answered — Stanley to Stephon Robinson for a 40-yard strike and a 31-27 lead with 10:42 left to play — it proved to be the last score for the visiting squad. Purdy put the Cyclones back in front for good with a 5-yard rushing score with 5:27 left, then iced the outcome with his fifth overall touchdown, which found Shaw.

A failed fourth-and-5 pass attempt to Daylon Charlot had delivered the ball back to the Cyclones at the KU 37 with 4:14 remaining.

“I would’ve rather had the ball in our hands than their hands,” Miles said of his fourth-down decision. "So the opportunity to go for it on fourth down when your quarterback is hot and the opportunity to keep that possession and keep that ball in our hands is just what I wanted to do, yeah. It didn’t turn out.”

Williams, a preseason All-Big 12 pick, finished with one of his best games, piling up 154 rushing yards on 19 attempts and 52 receiving yards on just two catches. Stanley moved into second all-time in Jayhawk career passing touchdowns (37), going 23-for-44 for 328 yards and three touchdowns. Parchment's eight catches for 86 yards were both team-high's.

Purdy was as good as advertised for the Cyclones (7-4, 5-3), finishing 29-for-42 for 372 yards, four touchdowns and one interception. He also had three carries for nine yards and a score.

Miles said his players were “absolutely sick” in the postgame locker room.

“They wanted this one, and it was right there in position for them to take it,” Miles said. “Fell short.”

KU can still finish the season on a high note, and with a small measure of program history.

If the Jayhawks can defeat No. 13 Baylor in a Nov. 30 finale at David Booth Kansas Memorial Stadium in Lawrence, this team would become its first since 2009 to win at least four games in a single season.

“We fell short today, but I feel like the offense is getting back on the right path, not only for next week but even for next year,” Parchment said on an ESPN+ postgame interview. “We’ve got a lot of guys coming back, and also, we want to put the seniors out in the right way as well. So we look forward to Baylor coming back home next week and look forward to putting on a show at The Booth.”