MANHATTAN — There was no last-minute magic for the Kansas State Wildcats against West Virginia.

The Mountaineers' Hakeem Bailey saw to that.

Bailey's interception with 28 seconds left spoiled a late K-State comeback attempt Saturday as West Virginia upset the Wildcats, 24-20, Saturday at Bill Snyder Family Stadium.

The Mountaineers, who came in as 14-point underdogs, improved to 4-6 overall and 2-5 in the Big 12 while ending a five-game losing streak. It was the second straight loss for K-State, which fell to 6-4 with a 3-4 Big 12 mark.

Down by four points, K-State was 92 yards away with 2:53 left and picked up five first downs to the West Virginia 30 before Skylar Thompson went deep down the middle toward Dalton Schoen, only to have Bailey leap high in front of him to pick it off.

West Virginia outscored K-State 10-0 in the fourth quarter, first closing within three points on a 51-yard Casey Legg field goal with 14:07 left, then grabbing the lead on a busted play with 11:07 left.

On a third down and 22 at midfield, Jarret Doege scrambled out of trouble to find Bryce Wheaton all alone down the left sideline for the touchdown.

Kansas State opened the second half with a 13-play, 70-yard drive that took 7 minutes, 4 seconds to regain the lead on James Gilbert's 3-yard option run. The score was set up by a 16-yard, third-down completion from Thompson to Schoen, giving the Wildcats first and goal at the 5.

Gilbert also caught two passes for 20 yards on the drive.

Thompson had another career-high passing day, completing 24 of 39 for 299 yards and a touchdown, but was intercepted twice. The Wildcats finished with 421 total yards, including 122 on the ground, where Gilbert returned from an injury to pick up 60 yards on 13 carries.

For West Virginia, Doege completed 20 of 30 passes for 234 yards. The Mountaineers rushed for 84 yards with Leddie Brown gaining 62 on 13 carries and Kennedy McKoy 34 on five attempts.

K-State got an early touchdown but then had to settle for a pair of field goals as West Virginia led 14-13 at the half.

For the second straight week, K-State got off to a dream start with an early touchdown, this time on its first play from scrimmage.

After the Wildcats' defense got a three-and-out, Thompson hit a wide-open Schoen in stride down the middle for a 68-yard touchdown.

West Virginia immediately came back with a 75-yard drive, capped by a 19-yard scoring pass from Doege to George Campbell.

K-State answered with its first sustained drive, an 11-play, 72-yard march covering 6 minutes, 18 seconds, but it stalled at the West Virginia 4 and Blake Lynch kicked a 22-yard field goal.

After West Virginia drove it again on its next possession, K-State appeared to be off the hook when Legg missed a 41-yard field goal. But a personal foul on the Wildcats' Trey Dishon kept the dreive alive and the Mountaineers went up 14-10 when Doege again hooked up with Campbell, this time for 15 yards.

The Wildcats did catch a break when Legg missed from 37 yards on the last play of the half after Lynch's 33-yarder at the end of a 12-play, 54-yard drive cut the West Virginia lead to one at the 43-second mark.

K-State outgained West Virginia in the half, 259 yards to 197, with 175 yards through the air. Thompson completed 10 of 14 passes in the half while Gilbert had 42 of the Wildcats 84 rushing yards.

Doege completed 11 of 17 first-half passes for 120 yards, while running backs Kennedy McKoy and Leddie Brown combined for 89 rushing yards.