AUSTIN, Texas — Cyrus Gray rushed for 223 yards and had two long touchdown runs to help No. 17 Texas A&M beat Texas 24-17 on Thursday night, sending the Longhorns to their first losing season since 1997.

AUSTIN, Texas — Cyrus Gray rushed for 223 yards and had two long touchdown runs to help No. 17 Texas A&M beat Texas 24-17 on Thursday night, sending the Longhorns to their first losing season since 1997.

Gray had touchdown runs of 84 yards in the second quarter and 48 yards in the third. Von Miller intercepted a tipped pass at the Texas A&M 11 with 2:37 left to kill what looked like a drive for the tying touchdown.

Jeff Fuller also caught a touchdown pass and Randy Bullock kicked a 50-yard field goal for the Aggies (9-3, 6-2 Big 12).

Texas' fifth home loss of the season means the Longhorns (5-7) won't be eligible for a bowl just one season after playing for the national championship.

The Aggies won their sixth game in a row and still have a chance to win the Big 12 South if Oklahoma beats Oklahoma State on Saturday. The Aggies would still be a long shot for the Big 12 championship game because of a tiebreaker based on BCS standings.

Cody Johnson rushed for 107 yards for Texas. Gilbert was 20 of 37 passing for 219 yards.

Gray is the first Texas A&M running back to reach 200 yards since 1995.

Texas A&M scored 17 points off three Texas turnovers and led 24-14 after Gray's second touchdown. Texas kicked a field goal after a blocked punt and used a long drive to march toward a touchdown before Garrett Gilbert's pass was tipped at the line of scrimmage. Miller, a defensive end who drifted back into coverage, leaped high to grab it.

Texas A&M punted the ball back to Texas with about 10 seconds left and Ken Wood had to pick the snap off the ground to get it away. Texas tried to block it and freshman returner Adrian Phillips let the ball bounce on the ground.

Time ran out in a mistake fitting of Texas' miserable season and several players threw up their hands in frustration.

Texas had never had a losing season under coach Mack Brown but completely fell apart after quarterback Colt McCoy and a host of other players ended their careers. The Longhorns lost five home games.

One season after winning the Big 12, Texas finished dead last in the South division.