BOULDER, Colo. (AP) _ For a team which ranked first in the nation in eight of the 12 major statistical categories compiled by the NCAA and which had beaten its opponents by an average score of 62-5, Saturday night's performance was disappointing.

It was good enough, however.

No. 5 Kansas State withstood a late Colorado rally to beat the No. 14 Buffaloes 16-9.

Eric Hickson ran for 137 yards, Martin Gramatica kicked three field goals and the nation's top-ranked defense pitched a shutout for three quarters.

The Wildcats (5-0, 2-0 Big 12) posted their 13th straight victory, equaling a school record, and broke Colorado's 11-game home winning streak in the series.

``I don't pay that much attention to margins of victory,'' Kansas State coach Bill Snyder said, ``but I don't think we played as well as we're capable of playing, certainly not as well as we expected to play. If there really is such a thing as an ugly win, then you've just witnessed one. This is not a joyous locker room.

``This was a great test for our defense. Until they drove for that field goal, I thought our defense played extremely well.''

Hickson said his fourth-quarter fumble ``almost cost us the game. Our offense made a lot of mistakes and made a lot of penalties. We let the defense down.''

Gramatica's third field goal, a 41-yarder early in the fourth quarter, gave Kansas State a seemingly comfortable 16-0 lead. But on the Wildcats' next series, Hickson fumbled a pitchout and Colorado's Terrell Cade recovered at the Kansas State 36.

Colorado quarterback Mike Moschetti, only 7-of-18 to that point, followed with three straight completions and found Marcus Stiggers in the right corner of the end zone for a 5-yard scoring pass with 5:42 left.

Kansas State punted and Colorado (5-1, 2-1) drove again, with Moschetti throwing 19-, 20- and 24-yard passes to Darrin Chiaverini. The drive stalled at the 3, and Jeremy Aldrich kicked a 20-yard field goal with 1:46 left.

With 37 seconds left, Colorado appeared to have forced another Kansas State punt, but the Buffaloes were whistled for an illegal-participation penalty and the Wildcats retained possession with a first down.

``We were trying to make a play and put Ben Kelly in for the punt return,'' Colorado coach Rick Neuheisel said. ``We had 11 guys on the field. (Special teams coach) Bobby Hauck thought that because we put Ben in and didn't put Roman (Hollowell) in, we had only 10 guys. It turned out that we had 12 guys on the field at an inopportune time.

``Whether or not it would have made a difference, no one can tell. But it certainly isn't the way you want to end the game. Our fans deserved 37 seconds to see what might have transpired.''

Kansas State capitalized on a short Colorado punt and a turnover to lead 10-0 at halftime.

With about five minutes elapsed in the game, Colorado was pinned deep in its territory by consecutive holding and personal-foul penalties. Punter Nick Pietsch, trying to avoid an inside rush, sprinted to his right and punted on the run, but his kick went out of bounds and covered only 17 yards to the Colorado 22.

Seven plays later, Gramatica kicked a 30-yard field goal.

Colorado crossed midfield for the first time early in the second quarter on Moschetti's 43-yard pass to fullback Andy Peeke. Two plays later, however, Moschetti fumbled the snap and Kansas State's Darren Howard recovered at midfield.

Michael Bishop immediately threw a 44-yard pass to Aaron Lockett, and fullback Brian Goolsby scored three plays later on a 2-yard run for a 10-0 advantage with 8:17 left in the half.

Moschetti's 37-yard pass to Roman Hollowell moved the Buffaloes to the Kansas State 35 later in the half, but Moschetti was sacked for the third time in the half, taking the Buffaloes out of field-goal range.

K-State mounted its only sustained drive of the game in the third quarter, marching 64 yards in 13 plays, and Gramatica kicked a 33-yarder.

Colorado cornerback Ben Kelly stripped the ball from Aaron Lockett for an interception at the Kansas State 39, but Colorado couldn't convert and surrendered the ball on downs.

The Wildcats, who entered the game with the nation's top-ranked defense, held Colorado to 151 total yards through three quarters.