When the Maryland men’s basketball team traveled to No. 1 Michigan State on Thursday, it suffered an unsurprising 30-point deconstruction at the hands of the Spartans that signified coach Mark Turgeon’s worst loss with the program.

But while Maryland’s triumph over Iowa on Sunday was also an expected outcome, the 91-73 win featured more drama and fireworks, the result of a game that was competitive deep into the second half but still offered the Terps consolation after their thrashing in East Lansing.

“It was a tough loss, but we were able to bounce back tonight,” forward Bruno Fernando said. “It feels good to get back on the winning track, so we’re just going to try to keep going.”

When Iowa coach Fran McCaffery stormed onto the court yelling at the referees with less than a minute left before halftime, earning a pair of technicals and an ejection, it seemed to be a season’s worth of frustration boiling over for the eighth-year head coach.

The Hawkeyes (9-9, 0-5 Big Ten) entered their matchup with Maryland winless in the Big Ten and owners of the conference’s worst defense. But when guard Anthony Cowan’s defense forced the Hawkeyes into a turnover at midcourt, leading to McCaffery’s ejection, Maryland (14-4, 3-2) held just a three-point lead.

“I didn’t think we played with the energy we needed to play with [early],” Turgeon said.

Iowa raced out to an 18-9 advantage, opening the game 6-for-9 from the field and 3-for-4 from 3-point range. Guard Dion Wiley revived the Terps with a quick eight points, and center Michal Cekovsky followed that with seven consecutive points to cap a 12-0 run that put the Terps up 27-24.

The Terps led by six after Cowan (15 points) made three of the four free throws gifted to him by McCaffery’s ejection, but Iowa regained a four-point lead less than four minutes into the second half.

A Cowan jumper and a 3-pointer from guard Kevin Huerter stopped the Hawkeyes’ 8-0 run, and after some further back-and-forth action Maryland put the game away for good.

“Credit Maryland for that,” McCaffery said. “A couple of times that we got up, they kept coming.”

Maryland went on a 19-2 run to take an 80-66 lead with about five minutes left. The Terps pounded the ball inside, taking advantage of Iowa’s soft interior defense and outscoring the Hawkeyes 56-22 in the paint. Meanwhile, Iowa shot just 42.9 percent in the second half.

“Our defense, as the game wore on,” Turgeon said, “just got better and better.”

After Iowa forward Tyler Cook was called for an offensive foul late in that stretch, Fernando stood over him, leading to a scuffle that earned both players technical fouls and drew Turgeon’s ire. Fernando was nearly flawless outside of that, though, scoring 21 points on 8-for-11 shooting and collecting seven rebounds while accumulating just two fouls.

It was a promising bounceback for the freshman, whose early fouls against Michigan State played a role in the Terps’ demise.

Earlier Sunday, Michigan State lost 80-64 at Ohio State, by far the Spartans’ worst performance of the season. To some, that could be viewed as a sobering indicator of Maryland’s relative strength in the Big Ten. The Terps, however, chose to view it — along with their uneven win — as a promising sign of their chances to compete in the conference and reach a fourth consecutive NCAA tournament.

“We knew we had another game today, we knew we had to get this one,” guard Darryl Morsell said. “Anybody could beat anybody on any given night. We know we have to bring it every single night to have success.”