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
Justin Fuente's decision to retain Bud Foster not only gives him a top defensive coordinator but a guy who knows recruiting to Virginia Tech.
Every season turns on a few big plays. Here are the five major moment that led us to a Michigan State-Iowa Big Ten title game.
One started high but got tripped up. The other stumbled early before finding its form. USC's and Stanford's different roads will converge on Saturday.
Recruits at schools like LSU and Rutgers say they've been very aware of the possibility of change at their would-be college programs.
The bottom dropped out for Florida at home against rival FSU as it scored only two points; Derrick Henry continued his run toward the Heisman.
Stanford and USC are prepping for the Pac-12 championship game and eight other teams are patiently waiting to hear their bowl destinations.