Updated

Stillwater, OK (SportsNetwork.com) - J.W. Walsh completed 24-of-38 passes for 245 yards and a touchdown to push the 21st-ranked Oklahoma State Cowboys over the Kansas State Wildcats, 33-29, at Boone Pickens Stadium.

Walsh led Oklahoma State (4-1, 1-1 Big 12) on a 75-yard fourth quarter drive that was capped off by a six-yard TD catch from Charlie Moore to put the Cowboys up 30-29. Ben Grogan kicked a 28-yard field goal with 2:24 left in the game to account for the final score.

Daytawion Lowe sealed the victory when he intercepted a Daniel Sams pass at the OSU 21 in the closing minute.

"It shows the maturity of our team. Even with some young guys out there, we can face adversity and overcome some tough circumstances. To be able to come up with a big drive and a huge stop on defense was huge," Walsh said.

Walsh and Jeremy Smith each rushed for a touchdown in Oklahoma State's sixth straight home win.

Sams connected on 15-of-21 passes for 181 yards with two touchdowns and three interceptions. The Kansas State (2-3, 0-2) signal-caller also ran for 118 yards and a touchdown.

The Wildcats nearly overcame 12 penalties and five turnovers to win the game.

"It's difficult, as it always would be," Kansas State coach Bill Snyder said. "In our history, we just have not been that kind of a football team. We haven't always been extremely good, but we haven't always turned the ball over and we haven't always been penalized. We had a chance to win even with it, but it sure makes it a heck of a lot harder."

Kansas State struck first. Glen Gronkowski hauled in a pass from Sams and exploded for 67 yards across midfield for the touchdown with less than two minutes to go in the first quarter.

Walsh fooled the Wildcats' defense with a flea flicker and connected with Jhajuan Seales on a 43-yard reception. Smith lunged into the end zone from two yards out on the next play to tie the game at seven.

A personal foul and a 12-yard catch from John Goodlett helped Oklahoma State push deep into Wildcat territory. Grogan nailed a kick through the uprights from 30 yards out for a 10-7 Cowboy lead.

Grogan's 43-yard kick attempt later in the second quarter was blocked by Travis Britz and caught by Kip Daily, who took it back for a 65-yard Kansas State touchdown.

Seales hauled in a 34-yard pass from Walsh to propel the Cowboys into Wildcat territory. A pass interference call placed the Cowboys at Kansas State's three before Walsh muscled his way into the end zone to give the Cowboys a 17-14 lead at the half.

The Wildcats took about seven minutes off the clock on their opening drive of the second half. Sams connected with a wide-open Torrell Miller from 17 yards out to put Kansas State back on top 21-17.

A pair of Kansas State turnovers turned into two field goals. Caleb Lavey picked off Sams to set up a 34-yarder and Tyler Johnson knocked the ball out of the hands of Jake Waters to allow Grogan to put OSU back in front, 23-21, with a 23-yard kick.

Oklahoma State's first penalty of the game proved to be costly. A pass interference call in the end zone moved the Wildcats to the Cowboys' 2-yard line. Sams was pushed by a pile into the end zone for a touchdown and Torrell Miller dove for the two-point conversion to give Kansas State a 29-23 edge with a little over six minutes to go.

The Cowboys would quickly strike back on a drive that lasted less than two minutes. A 15-yard completion to Brandon Sheperd would set up first and goal on the Wildcats' 6-yard line. Two plays later, Walsh found Moore for a six- yard touchdown.

Sams under-threw a deep pass and was picked off by Shaun Lewis, who returned the ball 24 yards to the Wildcats' 17 yard line. Grogan kicked a field goal from 28 yards out to extend the Cowboys' lead to 33-29.

Game Notes

Kansas State wide receiver Tyler Lockett injured his hamstring on a deep pass attempt in the second quarter ... Oklahoma State leads the all-time series 37-23 ... Kansas State had 336 yards, while Oklahoma State had 330 ... The Cowboys improved to 7-1 in games following a loss since 2010.