STILLWATER, Okla. (AP) — Oklahoma State had two chances to win one game and clinch the Big 12 championship, and could not get it done.

The disappointment was palpable after the No. 9 Cowboys lost their second straight game at home, falling 58-23 to No. 5 Oklahoma on Saturday night.

Despite a 45-35 loss to No. 7 Baylor in its previous contest, Oklahoma State (10-2, 7-2 Big 12, No. 11 CFP) still would have claimed just its second Big 12 title with a win, but instead watched as its intrastate rival celebrate on its field. It was the Sooners' fifth win out of their last six visits to Stillwater.

"It's tough knowing what we worked for all year, what we set our goals out at the beginning of the season. It was right there for us to go get and we just fell short," said backup quarterback J.W. Walsh, who got the start with Mason Rudolph hindered by a foot injury.

"But we've had a great year. Nothing's going to take away from those 10 wins and how hard we fought to win some of those games. These last two weeks hurt, but we're big boys, we'll move on and go get ready for the bowl game."

Walsh, who was primarily used in just red zone and short yardage situations during the season, played the entire contest except for one series in the second quarter. He completed 25 of 42 passes for 325 yards and two touchdowns, along with one interception. He also led the Cowboys in rushing, with 50 yards on 12 carries.

"We like J.W. and we like what he brings to the table," OSU coach Mike Gundy said. "We felt comfortable with what he could do for us offensively. We didn't really feel that Mason was healthy enough to play the game at full speed."

Baker Mayfield completed 17 of 25 passes for 180 yards and two touchdowns, while also rushing for 77 yards and another score, to lead Oklahoma (11-1, 8-1, No. 3 CFP) to its seventh straight victory.

Joe Mixon ran for 136 yards and two touchdowns, Samaje Perine had 131 yards and two scores, and Jordan Thomas intercepted two passes, returning one for a touchdown, for the Sooners.

"I'm elated at the way my players performed," said Oklahoma coach Bob Stoops. "They deserve the credit making plays out there. They did a great job in all parts of the game."

Gundy credited Stoops and his staff with coming up with a superior game plan.

"You have to give Oklahoma a lot of credit," Gundy said. "They outcoached us and outplayed us. I didn't do a very good job of getting our guys to play. They big-played us, they broke tackles and they were able to rush the football and we weren't. I had concerns about that going in, and unfortunately, it held to be true.

"They're a good football team. Obviously, they made plays when they had to and we didn't. We just kind of ran out of gas."

Oklahoma rolled to a 44-20 halftime lead. The Sooners gained 359 yards on 36 plays before the break. Perine had touchdown runs of 68 and 25 yards, and Mixon added a 66-yard scoring run in the half.

Rudolph, who limped at times during the loss to Baylor the previous week, entered the game in the second quarter, played one possession and threw an interception that Thomas returned 32 yards for a touchdown to give Oklahoma a 34-10 lead.

"At that part of the game, we needed a spark and we felt like he could do that," Oklahoma State offensive coordinator Mike Yurcich said. "We talked with Mason and he said he felt good and he's an ultra-competitive guy. He gave it his go."

Walsh threw his first interception of the season in the second quarter when Thomas stepped in front of a pass and returned it 36 yards to set up Austin Seibert's 40-yard field goal that made it 44-17. It was the second-highest point total for Oklahoma in any half of a Bedlam game, trailing just the 45 points the Sooners scored in the first half of the 1970 game.

Mayfield's 5-yard keeper in the third quarter put the Sooners up 51-23.

Early in the fourth quarter, Perine, just a sophomore, became the 10th Sooner to rush for at least 3,000 yards in a career.