MANHATTAN — No doubt there was a sense of relief.

After three straight losses to start Big 12 play, the Kansas State Wildcats were looking for something, anything, to get their season back on track.

But for quarterback Skylar Thompson, Saturday’s dominating 31-12 victory over Oklahoma State at Bill Snyder Family Stadium also served as an important reminder that football should be fun.

“That’s the hardest thing for me the last couple of weeks, going home after the tough losses to Texas and Baylor and it’s like I’m questioning how much fun I’m having,” Thompson said after guiding the Wildcats on four straight second-half scoring drives while the defense limited a high-powered Oklahoma State team to six points each half. “This isn’t fun that we’re losing. A win like that, it takes a lot of weight off your back and re-emphasizes that this is a game and it’s supposed to be fun.”

With the victory, K-State ended a three-game skid while improving to 3-4 overall and 1-3 in the Big 12. Oklahoma State, suddenly reeling after a fast start, fell to 4-3, 1-3 in the league.

Nobody took the weight off K-State’s back like running back Alex Barnes, who carried the Wildcats on his back with another huge game. Running behind a rejuvenated offensive line, Barnes finished with 181 yards and four touchdowns on 34 carries, plus caught three passes for 51 yards.

“The offensive line did a great job opening stuff up for us and seeing Barnes run as hard as he does, that motivates me,” said backup running back Dalvin Warmack, who added 32 yards on eight carries to the Wildcats’ 291-yard rushing effort.

Meanwhile, the defense kept the Wildcats in the game early, holding OSU to a pair of first-half field goals. K-State trailed 6-3 at the break.

“What a tremendous job,” offensive tackle Dalton Risner said of a defense that gave up just 311 yards to a Cowboy team that ranked 13th nationally in scoring and total offense. “To allow 12 points against Oklahoma State, those guys have been putting up 40, 45 points all season. It was a great job by the defense.”

Oklahoma State, which came in leading the Big 12 in rushing, got just 127 yards on the ground, and running back Justice Hill was limited to 41 yards on 11 carries. The Wildcats also forced two turnovers on a pair of Duke Shelley interceptions.

“We just got after it,” said linebacker Justin Hughes, who led the Wildcats with eight tackles, including one for loss. “We needed a win. We just held a good team to 12 points — they’re a real good team offensively and defensively — and they had the No. 1 rushing defense in the Big 12. We just put up 300 yards on them, so we can see what our offense can do and we can see definitely what our defense can do.”

The first half ended with a thud for the Wildcats, who had driven inside the Oklahoma State 20 with the clock winding down, only to come up empty when they didn’t have any timeouts left after a sack.

But that quickly changed after intermission when the defense forced a three-and-out and the offense put together a nine-play, 70-yard drive that took nearly five minutes off the clock. Barnes got the touchdown on a 9-yard burst up the middle, and the Wildcats were off to the races.

After the defense held again, the Wildcats consumed 3 1/2 minutes more with a 62-yard drive before Barnes took a direct snap and walked in from a yard away. Highlights included a 28-yard pass from Thompson to Barnes down the right sideline and Thompson’s 19-yard dash in which he made a dive for the pylon at the front right corner of the end zone.

Oklahoma State answered with its only touchdown, a 1-yard run by quarterback Taylor Cornelius, but the Wildcats countered with back-to-back 75-yard drives of their own to ice the game as Barnes scored from 8 and 3 yards.

“I think we played like we’re capable of playing for the most part,” said K-State coach Bill Snyder, whose Wildcats now have a bye week before back-to-back road games at Oklahoma and TCU.

In addition to Barnes, who became the third player in school history to eclipse 175 yards rushing and 50 receiving in one game, Thompson completed 11 of 22 passes for 130 yards and ran for 80 on 12 carries. He was 7 of 8 for 101 yards in the second half.

Cornelius completed 17 of 35 passes for 184 yards and rushed for 55 to lead Oklahoma State.