LAWRENCE, Kan. (AP) – Too many BYU mistakes cost the Cougars a victory in their first Big 12 Conference game.

Jalon Daniels threw two second-half touchdown passes to Luke Grimm, Kansas got a pair of score from its opportunistic defense, and the Jayhawks rallied to beat BYU 38-27 on Saturday in the Cougars’ Big 12 debut.

“Whenever you give up turnovers like that and you don’t get them yourself, it’s tough to win games, let alone only lose by 11 points,” said BYU head coach Kalani Sitake.

Cobee Bryant returned a fumble for the game’s opening touchdown, and Kenny Logan Jr. brought back an interception early in the third quarter for another score, helping the Jayhawks overcome a 17-14 halftime deficit and improve to 4-0 in back-to-back years for the first time since the 1914 and ’15 seasons.

Daniels finished with 130 yards passing and three touchdowns for the Jayhawks. Devin Neal added 91 yards rushing.

“The first half we did a lot of good things,” said BYU linebacker AJ Vongphachang. “But coming out in the second half we just weren’t where we wanted to be, just trying to do too much and not doing our job.”

Kedon Slovis was 30 of 51 for 357 yards with two TDs and two interceptions for BYU. But the Cougars (3-1) were imbalanced on offense, running 22 times for nine yards, and settling for two field goals in the red zone proved costly.

The Jayhawks, who struggled to put away Nevada last week, rolled into their conference opener averaging more than 500 yards per game. But the Cougars consistently put pressure on Daniels, who at times needed every bit of his athleticism just to get the ball away, and their defense held Kansas to one offensive touchdown in the first half.

The other score? That came on Bryant’s bone-jarring hit on BYU’s second play from scrimmage. The ball popped out, Bryant was there to scoop it, and he ran untouched 22 yards for the game’s opening score.

The Cougars refused to let the turnover set the tone, though. They answered with back-to-back 75-yard touchdown drives, then used another long drive in the final minutes of the first half to add a field goal for a 17-14 lead at the break.

That’s when the Kansas defense got into the act again.

On the third play of the third quarter, Slovis had his pass batted into the air by tight end Isaac Rex, off the hands of linebacker Jayson Gilliom and into the arms of Logan, who returned the interception 33 yards for a go-ahead touchdown.

When the Cougars answered with a field goal, the Jayhawks’ offense finally started humming.

Daniels left them swiftly down field, converting an early third down with his legs before finding Luke Grimm in the back of the end zone on another third-down play for a touchdown. And after Bryant picked off Slovis on fourth down to end BYU’s ensuing drive, the Jayhawks quickly drove down field, and Daniels found Grimm again to extend the lead to 35-20.

“It’s never a good feeling walking away knowing that you could have had a better output,” Slovis said. “Put up more points on the board and taking away some points from them.”

“We know that we have to be better offensively,” said Lassiter. “The defense went out there and played a great game. They only allowed 20-something points. We spotted them 14 on offensive ourselves. So we got to go in and clean up the turnovers and shake back for next week.”

BYU’s Keelan Marion scored midway through the fourth quarter, but the Jayhawks tacked on a field goal to put the game away.

BYU survived at Arkansas last week by scoring the last 17 points in a 38-31 win. But the Cougars looked downright tired in the second half Saturday, perhaps worn down by the physical nature of back-to-back road games against Power Five opponents.

Kansas defensive coordinator Brian Borland made it clear before the season that his group, which struggled mightily at times last year, would not hold back the Jayhawks this season. On Saturday, his defense was the difference in the outcome.

“We’ve got to find way to not make those mistakes and find ways to make plays,” Sitake said. “We didn’t do that well enough.”

BYU (3-1) next hosts Cincinnati in its Big 12 home opener Friday night at 8:15 p.m.