FORT COLLINS, Colo. — No. 23 Utah State survived after a game-ending penalty against Colorado State negated a last-second touchdown. The Aggies defeated the Rams 29-24.

Colorado State quarterback Collin Hill found Preston Williams with no time left on the clock for what would have been a game-winning touchdown. The Rams fans stormed the field in celebration as Utah State started to walk off dejected.

But Williams had stepped out-of-bounds before making the catch, and the official threw his hat to mark the spot. Williams was flagged for illegal touching, and the game ended in absolute confusion.

"I didn't see the hat," said head coach Matt Wells in a postgame interview with 1280 The Zone. "I saw the hands go up. In the headset, … Uani 'Unga, our outside linebackers coach, says 'Wellsy there's a flag.' So I saw the flag. I wasn't sure what that was. I never saw the hat. The line judge came over and said, 'Coach, they may have stepped out. If they stepped out, it's illegal touching.' And I said, 'Ballgame over.'"

This was, without doubt, the wildest finish to a football game in Utah State history.

Jontrell Rocquemore was the Aggie on the coverage on that final play.

"When he went up and caught that ball, I thought the world was going to end. Every bad feeling you can think of just hit me all at once," said Roquemore to 1280. "All I saw was him go up, I tried to challenge the ball, and he came down with it. I just thought we had lost a rough one. But the next thing you know there are flags on the field. It was one crazy, I don't even know how to explain it."

Utah State struggled to move the ball against the Rams as it managed just 310 yards of total offense, and it struggled to stop Colorado State as the Rams racked up 506 yards. Special teams struggled, too, as the Aggies averaged a mere 24.0 yards per punt. It seemed like a recipe for disaster for a team that had barely made its way into the College Football Playoff rankings this week.

But there was at least one big bright spot as the defense scored two touchdowns while the offense struggled to score. Aaron Wade picked off Hill and returned it 95 yards to the house early in the second quarter when the Rams were knocking on the door themselves. And, late in the third quarter, Rocquemore made a pick-six of his own with a 32-yard interception return for a touchdown.

Utah State was up six late and forced a Colorado State punt when disaster struck as Deven Thompkins muffed the punt and the Rams recovered. Hill didn't waste too much time finding Williams to put Colorado State up by one with 1:36 left in the game. But Jordan Love and the Aggies were perhaps too quick to respond as Love found Aaren Vaughns for a 33-yard touchdown with 43 seconds left.

"There was no panic. I mean, we trust our preparation. We go over it in practice every Wednesday," said Vaughns to 1280. "Jordan Love called the perfect play for me to run the corner route, so I just had to trust my technique, get my depth and look up, and the ball was right there. So when I caught the ball, I had to make a play. I had to be the playmaker."

But the 2-point conversion failed after the first attempt got waved off due to an ineligible receiver downfield penalty, which left the door open for Colorado State. This is what led to the Rams' last-minute heroics and heartbreaking loss.

"It's like the NCAA Basketball Tournament. Survive and advance. They don't say how you won. They just look at a win, and you say move on. And it doesn't matter if it happens like that or if you have a blowout win or you win 3-0. It doesn't matter. Survive and advance."

The Aggies also won a game by a touchdown or less for the first time since defeating Nevada on November 21, 2015.

Utah State will face Boise State on the Smurf Turf to finish the season next Saturday with the Mountain Division title on the line. The Aggies are now 10-1 for the first time in program history after a wild afternoon in Fort Collins.