It was the first tournament win since 2002 for the Wildcats (17-11), who suffered through a frustrating regular season, losing twice on last-second shots and twice in overtime.
The victory also may take pressure off embattled coach Jim Wooldridge and put Kansas State in line for its first postseason appearance in Wooldridge's five years.
In Friday's second round, the Wildcats will meet No. 9 Kansas, the regular-season co-champion which has beaten Kansas State 30 straight times.
Antoine Wright had 28 points for the Aggies (19-9), whose 12-game turnaround in the regular season tied for the biggest in Division I and made first-year man Billy Gillispie a near-unanimous choice for Big 12 coach of the year.
Acie Law sank a 3-pointer - his only bucket in 13 shots - that gave the Aggies a 46-41 advantage. But then Massey led the Wildcats on an 14-4 run for a 55-50 lead Texas A&M could never overcome.
The 6-7 Massey, guarded by 6-5 Chris Walker, worked inside for six straight points, capping the run with a short jumper over Walker.
After Wright put in two free throws for the Aggies, Massey drove the lane, drew Walker's fourth foul, then sank two free throws for a 57-52 lead.
When Justin Williams drilled a 14-footer, the Wildcats led 59-52 with 3:51 to play.
Texas A&M, still winless in the tournament since the inception of the Big 12 nine years ago, never got closer than five points. Going back to the old Southwest Conference, the Aggies have lost 12 straight postseason games.
Lance Harris and Fred Peete each had 13 points for Kansas State and Peete's 14 rebounds were a school record for a Big 12 tournament game. Justin Williams had 12 for the Wildcats and provided solid defense inside against Joseph Jones, the Aggies' standout freshman center who totaled nine points and 12 rebounds.
Wright had 19 points in the first half and led a 16-2 run with a pair of 3-pointers and a big dunk that gave the Aggies a 31-27 halftime lead.