MADISON, Wis. — Guarding Maryland men’s basketball forward Bruno Fernando at the top of the key, Wisconsin forward Ethan Happ lunged out a hand at Fernando’s nonchalant pass attempt, swatted it toward the sideline, then dove into the scorer’s table to save the ball and maintain possession for the Badgers.

For much of the Terps’ previous matchup with Wisconsin, Happ didn’t have many opportunities to make game-changing plays, stuck on the bench having picked up his fourth foul early in the second half.

But Friday, after already securing his double-double, Happ’s dive proved pivotal. What had been a six-point game quickly ballooned into a 10-point lead with 1:26 remaining, part of a 12-1 run sparked by the three-point shooting Wisconsin used the whole second half.

As guard Brad Davison pumped up the Kohl Center crowd at center court with under a minute remaining, coach Mark Turgeon stared at his bench, throwing substitutes in for the final moments of his 18th straight loss on the road to a ranked opponent. Through Davison’s 21 points and Happ’s 18, Wisconsin completed a second-half turnaround to beat the Terps, 69-61.

“That was tough,” guard Eric Ayala said of Happ laying out to secure the steal. “I respect him a lot for that. They were winning, too. He didn’t have to do that.”

Before facing the Badgers (16-6, 8-3 Big Ten), Turgeon acknowledged the threat Happ presents, but pointed out it was the players around him who nearly led a stunning comeback at Xfinity Center on Jan. 14. On Friday, Happ did play a crucial role — particularly when Fernando hit foul trouble midway through the second half — but Wisconsin’s six triples after halftime secured the victory.

Early on, it seemed Maryland (17-6, 8-4) was on its way to a convincing road win, building off Tuesday’s victory over Northwestern. Despite Cowan’s foul trouble in that game, the Terps put away the Wildcats with Ayala as the primary ball handler and Fernando and Smith contributing 36 combined points.

With Cowan on the bench for a breather midway through the first half Friday, Maryland again showed promise. The Terps went on a 10-4 run before the under-8 stoppage, including triples from Ayala and guard Aaron Wiggins, to establish a 24-17 lead.

Ayala shot 5-for-6 in the first half with 13 points and three triples. Ayala finished with 18 points, but couldn’t carry Maryland through a difficult second half.

“We all know Eric is a heck of a player,” Fernando said. “We see those things he did tonight every day at practice.”

Other than Happ inside, the Badgers tend to live and die by the three — they hit 11 second-half threes on Jan. 14 to draw closer at Xfinity Center. Guard D’Mitrik Trice hit Wisconsin’s first trey with 7:07 to go in the first half during an otherwise cold start from beyond the arc.

But with 15 seconds to go before intermission while holding an eight-point edge, Ayala threw the ball away. The freshman recovered and prevented Trice’s initial fastbreak attempt at the rim, but guard Brevin Pritzl found space in the corner and nailed a 3-point basket as time expired, slimming Wisconsin’s deficit to five.

“The turnover was the bigger thing,” Ayala said. “Our play kind of broke down, and it was kind of just a, ‘Let’s get it to Anthony, let him make a play.’ You know, I know better than to make that pass.”

And when Fernando picked up his second and third foul in quick succession to open the second half, it offered a way back into the game for Wisconsin. Happ went on a personal 7-0 run — mostly from the free throw line — to tie the game at 40.

After another Maryland run, threes from Pritzl and Davison again leveled the contest at 48 before two consecutive three-pointers from Davison gave Wisconsin its first advantage since the 15:29 mark of the first half.

“You don’t get too consumed with anything more than the current, the present, the possession we’re heading into next,” Wisconsin coach Greg Gard said.

The Terps responded with two straight buckets and held a 55-54 lead with five minutes left. But after a timeout, forward Aleem Ford nailed a 3-pointer that was the beginning of a 12-1 run over the next three minutes, putting the Terps down 10 when Turgeon called a timeout with 1:26 to play.

By then, the game was out of reach. Wisconsin secured its win at home, moving the Badgers above Maryland into fourth place in the Big Ten while handing Turgeon and the Terps an 18th straight loss to ranked teams on the road.

“I mean, my guys battled,” Turgeon said. “We just weren’t good enough in the end. It’s not about being ranked or not ranked.”