The victory breaks a three-game skid by the Aggies and makes them eligible for a bowl game. It extends the Jayhawks' Big 12 conference losing streak to 11 games, with their last win coming against Colorado on Nov. 6, 2010.
The Aggies built a 23-0 lead in the first quarter behind two touchdown runs by Gray and a TD pass by Tannehill. Three second-quarter turnovers by Kansas (2-9, 0-8) helped Texas A&M (6-5, 4-4) extend the lead to 44-0 by halftime.
Kansas quarterback Jordan Webb threw for 133 yards and lost two fumbles, threw an interception and was sacked six times.
Defensive end/linebacker Damontre Moore led a smothering defensive effort by A&M, finishing with eight tackles, two sacks, two forced fumbles and a fumble recovery.
Tannehill, who was replaced by backup Jameill Showers with eight minutes left in the third quarter, was 21 of 26 for 280 yards. Gray had nine carries for 94 yards to surpass 1,000 yards rushing for the season. He's the third player in school history to post consecutive 1,000-yard rushing seasons.
Gray didn't play after halftime and was on the sideline in street clothes with what A&M officials called an unspecified injury.
Ryan Swope had nine receptions for 137 yards and two touchdowns for Texas A&M.
The Aggies have lost three games this season after leading by double figures at halftime. There was no such letdown in this one, with A&M adding a rushing TD by Ben Malena, a field goal and a 72-yard punt return for a score by Dustin Harris in the third quarter to make it 61-0.
James Sims ran for 88 yards and scored on a 15-yard run with less than a minute remaining to make it 61-7.
The Jayhawks couldn't get anything going on offense before that drive and came close to scoring only once, but a 39-yard field goal attempt early in the fourth quarter sailed wide left.
Turnovers doomed Kansas in the second quarter, with the first one coming on a fumble that was recovered by Moore. The Aggies took advantage three plays later when Tannehill found Swope on a 52-yard touchdown pass on which he shook off two defenders on his way to the end zone to push the lead to 30-0.
Steven Terrell intercepted Webb on the Jayhawks' next possession and Gray's third touchdown came a few plays later to leave the score at 37-0.
Another turnover by Webb, this one on a fumble when he was sacked by Moore, ended the next Kansas drive. The Aggies were unable to score after that mistake, and Kansas got the ball back after Tannehill's pass on fourth down fell incomplete.
Nate Askew grabbed a 27-yard touchdown pass from Tannehill a minute before halftime that left the Aggies up 44-0.
The Jayhawks got the ball back, but Moore sacked Webb and caused a fumble, which Kansas recovered to end the first half.
Gray put A&M up 7-0 when he scored on a 30-yard run on the Aggies' first drive.
Texas A&M got a safety in the first quarter when the snap on a Kansas punt attempt sailed over the punter's head and out of the end zone to make it 9-0.
Tannehill's first touchdown pass to Swope for 27 yards stretched Texas A&M's lead to 16-0 later in the first quarter.
Gray scored on a 36-yard run on which he tightroped the sideline and dashed into the end zone untouched to make it 23-0 with about two minutes left in the first quarter.
adidas Youth Texas A&M Aggies #12 Maroon Replica Football JerseyShop
Ohio State remained No. 1 in the AP Top 25 and tied a poll record Sunday despite lagging support from voters. Meanwhile, No. 2 TCU and No. 3 Baylor edged forward and No. 4 Michigan State slipped.
Texas cornerback Kris Boyd has apologized for retweeting a Texas A&M fan during halftime of Texas' 50-7 loss to TCU on Saturday.
The Big 12 on Sunday acknowledged an officiating mistake that incorrectly awarded Oklahoma State a first down Saturday and said the officials involved would be disciplined.
Will Grier threw four touchdown passes to four receivers -- all in the first half -- and No. 25 Florida downed third-ranked Mississippi 38-10 on Saturday night.
Leonard Fournette highlighted his SEC-record third straight 200-yard game with a 75-yard touchdown run, and No. 9 LSU overcame Eastern Michigan 44-22 on Saturday night.
Texas A&M receiver Ricky Seals-Jones, who was ejected for targeting midway in the second quarter of Saturday's game, took to Twitter late in the game, retweeting a tweet that questioned the call.