Amir Coffey’s spot-up 3-pointer had pulled Minnesota within four and finally stolen back some momentum from the Maryland men’s basketball team late in the second half Tuesday.

But on the other end, just as Anthony Cowan received a pass at the top of the key, a miscommunication led to Coffey leaving him open for a split second. Cowan rose and buried the 3-pointer, giving him 20 points on the night and re-establishing Maryland’s seven-point lead with four minutes left in Minneapolis.

That was the finishing blow in a second half that turned into a lopsided battle between the two star guards, but Cowan wasn’t done. With the game in hand late, he buried one more triple for good measure, giving him a season-high 27 points.

The Terps trailed by six at halftime but caught fire in the second half, outscoring the Golden Gophers by 21 points and running away with an 82-67 victory.

“Cowan absolutely killed us the second half,” Minnesota coach Richard Pitino said. “He’s fast, and we got stretched out instead of being connected defensively.”

While Cowan was leading Maryland’s onslaught on offense, the Terps (13-3, 4-1 Big Ten) switched to a zone defense that befuddled the Golden Gophers offense. Minnesota (12-3, 2-2) scored 10 points in the final 10 minutes, a combination of missed open looks and a lack of comfort against the scheme.

“Out of desperation, we went zone,” coach Mark Turgeon said. “They missed some shots, and it carried over to some good shooters [on our end].”

Changing to zone sparked a 12-2 run punctuated by 3-pointers from freshmen Ricky Lindo and Aaron Wiggins, erasing the halftime deficit and giving the Terps a 59-56 lead with 10:44 to play. Minnesota never got back level.

“[Lindo] hit a three, and then Aaron hit a three and I felt pretty good about things,” Turgeon said. “Those young guys are just out there playing. They’re just playing and letting Anthony do his thing.”

After spending nearly half the season relying almost exclusively on six players and paying the price late in games, Turgeon has reaped the rewards of giving more minutes to bench players such as Lindo and guard Serrel Smith as of late.

Maryland had struggled down the stretch against Purdue and Nebraska, but it separated from Minnesota on Tuesday. A game that was close for 30 minutes suddenly turned into a blowout, with the Terps closing the contest on a 35-13 run.

Turgeon’s squad entered Tuesday tied for third in one of the deepest conferences in the nation. But the Terps had gotten there against a soft early-conference slate and were unproven on the road, having lost a close game at Purdue and beating one of the Big Ten’s weakest teams in Rutgers.

So when Minnesota raced out to a 15-8 lead and had a six-point lead at halftime, it seemed Maryland was headed for another dud, or the type of tight road game it consistently lost last year.

“We couldn’t guard them,” Turgeon said. “Absolutely could not guard them.”

But forward Jalen Smith kept the Terps in the game while they figured out their defense. The freshman played his best game of his career, Turgeon said, and most of the production came before halftime. Smith had 14 points in the first half and finished with a career-high 21.

Cowan and Coffey, meanwhile, combined for just nine points before intermission, which Minnesota entered with a 40-34 lead.

“[Cowan] was bad in the first half,” Turgeon said. “For him.”

The Golden Gophers opened their lead back to eight a couple of minutes after halftime, but then the game flipped. Maryland’s switch to zone and lights-out shooting were aided by Minnesota shooting an abysmal 9-for-23 from the free throw line — a stat that caused Turgeon to compare the game to the Terps’ 78-74 loss to Seton Hall, in which Maryland went 12-for-20 on free throws.

Pirates guard Myles Powell owned that game, scoring 27 points and willing his team to an impressive win at Xfinity Center.

But Tuesday was Cowan’s night, and his 27 points on 12 shots closed out Maryland’s most impressive road victory since 2016-17, a crucial result for the Terps to get some separation in the crowded Big Ten standings.

“We fed off of him,” Turgeon said. “We just kept saying, ‘Go to Anthony,’ and our offense got better.”