It was a must-win game in every sense of the term. The Terrapins men’s basketball team had a distinct lack of statement victories and no other current top-25 tests remaining on its regular-season slate. An upset over No. 2 Duke would be necessary to stay relevant in the NCAA tournament discussion.

So before the Terps hosted the Blue Devils on Saturday night, coach Mark Turgeon discussed passion with his players. He stressed pride, and he talked about the matchup’s significance to a win-starved fan base desperate to experience March Madness for the first time in three years.

The youthful Terps were listening. They mustered enough magic to squeak out an 83-81 win, prompting students in a raucous home crowd of 17,950 to storm the court in jubilation. The victory provided a needed boost to the Terps’ postseason resume and squelched a six-game skid against the Blue Devils.

“I wanted to beat Duke. It means a lot,” said Turgeon, who may not get that opportunity at Comcast Center again given the Terps’ upcoming move to the Big Ten. “I know what it means to our fan base.”

Those fans started lining up along the hill outside Comcast at about 10 p.m. Wednesday, and celebrated into the night on Route 1. They mobbed the night’s heroes on Gary Williams Court, and guard Nick Faust said some girls even tried to kiss his jersey.

The Terps seemed to ride the crowd’s support all game, coming off a six-day break to play some of their most inspired basketball of the season. They shot 60 percent from the field, outrebounded the Blue Devils, 40-20, and connected on 25 of 34 free-throw attempts.

But a season-high 26 Terps turnovers helped a weary Duke group hang around. It wasn’t until guard Quinn Cook’s last-second heave met iron that the Terps secured their first win over Duke since March 2010.

Center Alex Len, playing before more than a dozen NBA scouts, proved critical in his team’s first true statement win of the season. The Ukrainian big man scored a team-high 19 points on 6-of-8 shooting, grabbed nine rebounds and blocked three shots. Len also teamed up with center Shaquille Cleare to stifle national player of the year candidate Mason Plumlee, who bullied Len three weeks ago in Cameron Indoor Stadium.

Plumlee finished with easily his worst stat line of the season. The senior forward totaled just four points and three rebounds while shooting 2-of-7 from the field in his 33 minutes.

“We just tried to play physical with him,” said Len, who topped the 12-point mark for the first time in six games Saturday. “He’s one of the best players in the ACC, but I think it worked.”

The game was one long prizefight. Both teams continuously exchanged blows, trading leads 10 times and evening the score on five occasions.

Such was the case the entire first half. The Terps weathered a stellar shooting display from Seth Curry — the senior guard made his first six shot attempts en route to a game-high 25 points — and entered the break with a 35-34 lead.

The Terps (18-7, 6-6 ACC) pounded the ball inside early in the second half, piecing together an 18-9 run that secured a 10-point edge with about 15 minutes remaining. But Duke (22-3, 9-3) responded with a 7-0 rally of its own, and Turgeon called a timeout midway through the half to regroup.

Unlike past games in this rivalry, no Terps collapse arrived. A Seth Allen layup gave Turgeon’s squad an eight-point edge with 1:56 left, and the Terps staved off a furious Blue Devils comeback bid down the stretch.

After Jake Layman hit one of two free throws to capture an 81-78 lead with 26 seconds remaining, the freshman forward made a crucial error on Duke’s ensuing possession. Layman fouled guard Rasheed Sulaimon on a three-point attempt, and Sulaimon hit all three free throws to tie the game at 81.

Turgeon called a timeout and drew up a play for Len. But Allen, who finished with 16 points and eight turnovers, saw an opening and drove through the lane. Cook hit him on the arm, sending the rookie to the charity stripe with the game on the line.

Allen flashed a wide smile, took a deep breath and sank both attempts. Allen later said he wasn’t too concerned during the nationally televised moment. Turgeon had asked each player to attempt 500 free throws during the Terps’ extended hiatus, and Allen had hit 427 of them. All that was left between the Terps and solace was Cook’s last-second miss.

“We felt like we needed a big win and this was it,” Allen said. “Going into the locker room after the game, everybody was just relieved.”

The Terps still have plenty of work ahead of them before locking up an NCAA tournament berth. They’ll likely need to win at least five of their final six regular-season games — including four road tests — and notch at least one ACC tournament victory to move off the bubble and into next month’s 68-team field.

But Saturday night wasn’t just about keeping the Terps’ postseason hopes alive. It was about passion. It was about a rivalry that’s become a bit one-sided in recent years. It was about giving a hungry fan base something worth savoring.

“We talked about pride and passion, and playing with those two things tonight, for us and for our fans,” Turgeon said of his pregame speech. “Our fans were just tremendous. We never quit; we never had a doubt we were going to win the game.”

sportsdbk@gmail.com