A back-and-forth Big Ten duel came down to one final shot, a 3-point try by Indiana's Robert Johnson that clanged off the rim as time expired.
Anthony Cowan scored 15 points and Huerter had 11 for the Terrapins (15-2, 3-1), who have won two straight since blowing a 12-point lead in the final six minutes at home against Nebraska.
James Blackmon Jr. led Indiana (11-6, 1-3) with 22 points and Johnson added 13. The Hoosiers have dropped four of five.
Indiana trailed 66-63 before Blackmon made a layup and a 3-pointer. Maryland center Damonte Dodd answered with a put-back of a Trimble miss, but two free throws by Juwan Morgan put the Hooisers back in front.
That's when Huerter took over. After drilling a 3-pointer from deep on the left side, he snagged a rebound on the other end and whisked an outlet pass to Cowan, who made a layup for a 73-70 lead.
OG Anunoby followed with a dunk, and Trimble made both ends of a 1-and-1 with 8.2 seconds to go before Johnson's miss.
After his jumper from the left side bounced away, Johnson slumped to the floor in agony.
Trimble's 18 points came on 5-for-16 shooting, but he was 8 for 10 at the line.
Blackmon sandwiched a pair of 3-pointers around a Maryland layup to give the Hoosiers a 55-50 lead with 12:09 remaining.
Trimble responded with a twisting drive that faked Indiana's Juwan Morgan off his feet. But every time the Terrapins got close, Indiana had an answer.
A 3-pointer by Johnson made it 60-55, and Anunoby tacked on a three-point play for a 63-59 advantage.
The Terrapins finally closed the gap, using layups by Cowan and Trimble to pull even with 7 minutes to go.
A first half that featured five ties and nine lead changes ended with Trimble driving for a layup at the buzzer to put Maryland in front 39-38.
The Terrapins led 21-14 and 34-29 before the Hoosiers rallied behind Blackmon, who scored nine points before the break.
Maryland returns to action when it kicks off a two-game road swing with a tilt at Illinois on Jan. 24.
- Damonte Dodd matched a career-high with six blocks
- Melo Trimble moved up to 20th all-time on Maryland's career scoring list, passing former teammate Dez Wells
- Maryland is now 31-4 when Trimble gets to the free throw line at least seven times