PHOENIX (AP) — Wisconsin had a new coach on the sideline, with the interim coach still calling the shots. The Badgers had several new players in key positions, including quarterback.

A long, sometimes-difficult season came to a conclusion with more adversity – and, eventually, a win.

A 17-point lead nearly erased, Wisconsin dug down for one last defensive play to beat Oklahoma State 24-17 in the Guaranteed Rate Bowl on Tuesday night.

“It ended exactly the way we wanted it to — we got the win,” said Braelon Allen, who ran for 116 yards and scored on a 20-yard touchdown.

Luke Fickell, hired away from Cincinnati after a trip to the College Football Playoff last season, joined the team on the sideline for the bowl game. He wasn’t there to run the show, though; all the decisions were left to interim coach Jim Leonhard.

The Badgers had everything working in the first half. The offense had balance, the defense stifling while they built a 17-point lead.

In the second half, Wisconsin (7-6) bogged down on the slippery Chase Field turf and the defense started giving up chunk plays as the Cowboys rode their way back.

Cedrick Dort finally ended Oklahoma State’s momentum, intercepting Garret Rangel’s pass with three minutes left, preserving the Badgers’ eighth win in their past nine bowl games.

“This is what I envisioned what this was about from afar,” Fickell said. “And that’s what they’ve shown me over the last three and a half weeks: they want to be here, they want to do it together and they want to do it the right way.”

The Cowboys lost four of five to close out the regular season and struggled offensively while falling into a 24-7 hole midway through the third quarter. Rangel had the lone offensive highlight in the first half with a big assist from Stephon Johnson Jr., who broke a couple of tackles to turn a swing pass into an 84-yard touchdown.

“We had the one big play, but other than that we weren’t able to sustain anything,” Oklahoma State coach Mike Gundy said.

Rangel led Oklahoma State back, throwing for 229 yards and two touchdowns in place of Spencer Sanders, who entered the transfer portal.

The freshman improvised on a fourth-and-goal by shoveling a pass to Ollie Gordon while in the grasp of a defender to open the fourth quarter and set up Tanner Brown’s 24-yard field goal to pull the Cowboys to 24-17.

With momentum back on Oklahoma State’s side, Rangel tried make a big play downfield after another Oklahoma State second-half defensive stop. Dort pulled it back to the Badgers by cutting inside John Paul Richardson for what ended up being the game-clinching interception.

“We came out here with a little bit of a reduced roster and new guys were involved, and we had to kind of find our way,” Gundy said. “Guys competed practice hard for three weeks. Had a great week of practice out here, so I was proud of them.”

THE TAKEAWAY

Oklahoma State: the Cowboys revved up their offense a little too late to mount the comeback, leaving coach Mike Gundy at nine bowl wins, tied for seventh place on the career list.

Wisconsin: the Badgers had a new coach on the sideline and several new players a key positions, including quarterback. Wisconsin grinded out the win after its offense stalled, sending Leonhard off with a win.

WOLF’S TURN

Among the many changes Wisconsin faced was at quarterback after Graham Mertz, a three-year starter, entered the transfer portal.

The Badgers turned to fifth-year starter Chris Wolf, who attempted six passes before arriving in the desert.

Wolf had some success on short passes early and found Hayden Rucci on a 15-yard TD pass in the second quarter. He also threw an interception in the end zone on Wisconsin’s second drive and finished 16 of 26 for 116 yards.

“Chase played well. He controlled what he could control, he took shots and I never saw him bat an eye,” Fickell said.

UP NEXT

Wisconsin: Fickell will continue to fill out his staff and roster after losing several players who declared for the NFL draft or went into the transfer portal. Wolf will be back and have momentum on his side after winning a bowl game.

Oklahoma State: The bowl experience should help Rangel headed into next season, when he will be the frontrunner to be the starting quarterback. Most of the Cowboys’ skill players should be back, too.

___

More AP college football: https://apnews.com/hub/college-football and https://twitter.com/AP_Top25. Sign up for the AP’s college football newsletter: https://apnews.com/cfbtop25.