IOWA CITY, Iowa — It seemed the Maryland men’s basketball team’s late-game magic might run out with three minutes to play in its tilt at Iowa on Thursday night.

Coach Mark Turgeon’s team, which has won eight games by six or less points, trailed by three and showed little evidence it would hang around in the closing moments. The Hawkeyes zone defense the Terps carved for easy layups in the first half starting turning them over and forcing perimeter jumpers. On the defensive end, they struggled to secure rebounds. Iowa finished with 20 offensive boards, compared to six for the Terps, and the Hawkeyes turned those extra possessions into 19 second-chance points.

But as he’s done all season, Melo Trimble’s individual effort in the final moments propelled Maryland to a victory, this one a 84-76 win at Carver-Hawkeye Arena. Thursday, his damage came behind the three-point line as the Terps picked up their third straight road win to start Big Ten play.

“He hasn’t done it lately, the last couple of games,” Turgeon said of Trimble making shots down the stretch. “So for him to step and do that was terrific.”

Trimble has made about a third of his attempts the past four games, but his struggles didn’t prevent him from launching open looks. His fourth 3-pointer of the contest tied the game at 72, while his fifth, which came on the next possession, helped Maryland (17-2, 5-1 Big Ten) regain the lead. Trimble followed that make by staring down the student section. A once-energetic crowd, which morphed into a frenzy as Iowa erased a 13-point second-half deficit, was now silent.

Forward Justin Jackson’s two foul shots completed the Terps’ 8-0 spurt, one the Hawkeyes (11-9, 3-4) couldn’t counter.

“I had that in my mind the whole game to just [stay] aggressive and push the lead out,” Trimble said. “Unfortunately, we weren’t able to do that today…but I had that aggressive mindset to keep shooting.”

Trimble led all scorers with 20 points, but the team’s offensive production came from seven places. Guard Anthony Cowan did much of his work by driving the lane — he scored 15 points and made 5 of his 6 attempts — while Trimble went 5-for-9 from beyond the arc. Maryland’s frontcourt benefitted from its guards’ vision, as forwards Damonte Dodd, who fouled out with about four minutes left, and Justin Jackson converted easy layups and dunks throughout the game. The duo finished in double figures.

The balanced scoring allowed Maryland to dominate the first half despite facing a variety of defenses. When Iowa played a 2-3 zone, the Terps threw the ball to one of their frontcourt players at the foul line, allowing him to feed teammates down low or for 3-pointers in the corners.

With assists on 14 of its 16 first-half field goals, Turgeon’s bunch entered intermission with a 41-32 advantage.

Trimble spoke after the game about how Iowa made adjustments to their zone in the second half that disrupted Maryland’s offensive flow. The Terps still fed the ball into the paint, but Trimble said the Terps weren’t strong enough with the ball, leading to 11 second-half turnovers. In total, the Hawkeyes scored 30 points off of the Terps’ 21 giveaways.

Iowa used a 10-0 run to pull within three midway through the second frame. With less than five minutes to play, the Hawkeyes took a three-point lead. Hawkeyes forward Ahmad Wagners’ long ball prompted Turgeon to call a full timeout, when he inserted guard Jared Nickens.

“We’re going to hit a three here, and we’re going to win this game,” the sixth-year coach told his team in the huddle. “We’ve got to be the tougher team the last four minutes.”

Nickens, who played seven minutes, obeyed Turgeon’s orders with a trey out of the timeout, but the Terps defense didn’t do its part. Iowa scored a layup on its next possession and a free throw after that. Maryland’s undefeated run away from Xfinity Center was still in danger.

Turgeon didn’t tell Trimble to look for his shot down the stretch. He didn’t want to put more pressure on the Upper Marlboro native, who has led the Terps in scoring the past three seasons.

Yet with the Terps on the brink of their first road defeat, Trimble ensured they would return to College Park still atop the Big Ten standings.

“This was a great game for him,” guard Jaylen Brantley said. “He played really poised, and I just feel like we’re going to keep building off every game.”