LAWRENCE, Kan. (AP) West Virginia did what most people expected it would against Kansas in the first half Saturday, building the kind of lopsided advantage that should have made it an easy afternoon in Memorial Stadium.

Instead, the banged-up Mountaineers blew much of that lead during a stagnant third quarter.

It wasn't until the fourth that Will Grier and Co. got rolling again. The star quarterback scored twice on the ground in the closing minutes, and finished with 347 yards passing while accounting for four scores, to a sew up a 56-34 victory that was far more difficult than coach Dana Holgorsen had envisioned.

''Looked good at times, looked bad at times,'' Holgorsen said, wiping sweat from his brow. ''We were either rolling on offense or we were inept. I don't know what it was.''

At least there were enough good times to overcome the bad.

David Sills V had 130 yards and two TDs receiving, and Kennedy McKoy also reached the end zone twice, as the Mountaineers (3-1, 1-0 Big 12) beat Kansas (1-3, 0-1) for the sixth time in seven meetings.

''We just got a little relaxed,'' Sills said, ''and that's something we can't do.''

West Virginia overcome a career game from sophomore Khalil Herbert, who ran for 291 yards and two touchdowns. It was the third-most yards by a Kansas player on the ground in school history, trailing only a 396-yard performance by Tony Sands in 1991 and a 294-yard effort by Nolan Cromwell in 1975.

''We've been working on it all week, and the O-Line has been doing a great job. Today we just came out and executed,'' he said. ''Thanks to the big boys up front.''

Peyton Bender added 197 yards and a TD through the air, but he also threw a pair of picks, one of which was returned for a touchdown. And a porous defense allowed 40 or more points for the third straight game.

''I thought the quarterback for them played really well today, and their running backs played really well,'' Kansas coach David Beaty said, ''but their O-Line did a pretty good of protecting them.''

The Mountaineers looked as if they'd cruise past the Jayhawks again when they put together four straight touchdown drives in the first half. Each covered at least 80 yards, none took more than 3:22 off the clock, and the result was a 28-3 lead midway through the second quarter.

Herbert finally stopped the onslaught with a 67-yard touchdown run, but the Mountaineers' Mike Daniels picked off a tipped pass a couple minutes later, and it was 35-13 by halftime.

That's when the Mountaineers' offense suddenly hit the skids, punting four times and turning it over once during a five-possession span. Meanwhile, a defense that had started to bottle up Herbert became leaky, thanks in large part to a slew of injuries, allowing short touchdown runs a couple minutes apart to make it 35-27.

Suddenly, a sparse crowd that turned out on a hot, sunny afternoon began to think back to 2013, when the long-suffering Jayhawks stunned the Mountaineers 31-19 on a cool November day.

The teams swapped TDs in the fourth quarter, the Mountaineers getting a second chance at the end zone after an offside penalty on a field goal, and it was still 42-34 with 7:35 left in the game.

Grier answered with a QB keeper then scored again a few minutes later to put it away.

''I am seeing improvement, which is good. Very discouraged about that fourth quarter,'' Beaty said. ''That's not how I felt like that game should've ended up.''

STATS AND STREAKS

The Mountaineers had 635 yards total offense. The Jayhawks had 564. ... The teams combined to run for 655 yards. ... Grier has thrown for at least 300 yards and Justin Crawford (125 yards and a TD Saturday for West Virginia) has run for at least 100 in four straight games. ... Herbert has run for 428 yards combined his past two games.

THE TAKEAWAY

West Virginia: Grier had the Mountaineers humming early and late, but the offense sputtered out of rhythm during a long stretch in the middle of the game. Their counterparts on defense didn't help much, getting pushed around by the Kansas offensive line most of the afternoon.

Kansas: Miscues doomed the Jayhawks, from the pick-six to penalties when they were going for it in fourth-and-short situations. But while Beaty insists there are no moral victories, the way Kansas responded to adversity was something to build upon.

UP NEXT

West Virginia has a week off before visiting No. 16 TCU on Oct. 7.

Kansas also gets a week off before Texas Tech visits Oct. 7.

---

More college football coverage: http://collegefootball.ap.org and www.Twitter.com/AP-Top25

Copyright 2017 by STATS. Any commercial use or distribution without the express written consent of STATS is strictly prohibited.