Bryn Forbes scored 25 points and Denzel Valentine had 19 points and 14 rebounds to help the Spartans (17-4, 4-4 Big Ten) snap a three-game losing streak.
The Terrapins (17-3, 6-2) have lost just two of their last 13 games and both setbacks were in the state of Michigan. They fell to the Wolverines on the road earlier this month.
Trimble now has six games with 20 or more points this season, including contests versus Georgetown, UConn, North Carolina, Wisconsin and Northwestern.
Michigan State led 35-29 at halftime. The Spartans made several stops late in the game, and also hit 23 of 29 foul shots.
Maryland welcomes No. 9 Iowa for a pivotal Big Ten matchup on Thursday at 7 p.m. at XFINITY Center.