Seth Allen was devastated when he looked at Dez Wells just after the end of regulation in the Terrapins men’s basketball team’s ACC finale yesterday afternoon. Moments earlier, Virginia forward Anthony Gill sent the game into overtime with a finish off a lob pass with less than one second remaining, momentarily snatching a historic victory from the Terps.

But the Terps still had five minutes to play in their last regular-season ACC game before an announced sellout crowd of 17,950 at Comcast Center. So Allen had a brief conversation with his backcourt partner while walking to the bench.

“I looked at Dez, and I told him that we’re not going to lose,” Allen said. “He looked at me, and he was like, ‘We got to take over.’”

Several minutes after Allen and Wells exchanged words, they welcomed a deluge of Terps fans with smiles on their faces and celebration on their minds. Behind the two guards, the Terps outlasted Virginia in overtime to earn a 75-69 victory and send the crowd onto the court and the program into the new era with a thrilling win.

Allen scored the Terps’ first five points in overtime to finish with a game-high 20. Wells poured in 16 of his 18 points in the second half and overtime. And forward Jake Layman buried four late free throws to help end the Cavaliers’ 13-game winning streak.

It was the Terps’ first win over a top-25 team in a season mostly marked by disappointing losses. And on a night with significant historical implications, Allen ended the final ACC game at Comcast by celebrating with a mob of win-starved fans.

“Somebody tried to pick me up,” Allen said with a smile. “It was just a whole bunch of people giving high-fives and stuff. It’s great. It just shows everybody who was there, man, it was fun.”

From autograph signings to free giveaways, the program had several nods to its 61 years in the ACC yesterday as famous alumni lined the court. Former coach Gary Williams sat courtside, and late in the second half, he was joined by former Terps guard and NBA All-Star Steve Francis, who wore a Boston Celtics Len Bias jersey.

“We always play for Maryland, but today, we played for former players, former coaches, all our fans,” coach Mark Turgeon said. “There was probably a lot of Maryland fans who hadn’t watched all year that watched today just because it was the last ACC game we were playing. Really proud of my group.”

It wasn’t a smooth run to the marquee triumph, though.

The Terps (17-14, 9-9 ACC) appeared poised to hold off Virginia (25-6, 16-2) when guard Joe Harris committed an offensive foul with less than five seconds to play, and Layman hit two free throws to put the Terps up 64-61. But Turgeon asked his team to foul while holding the three-point lead, and the common tactic backfired.

“I don’t ever foul,” Turgeon said. “But it’s been the strangest year I’ve ever been a part of, and I did it backwards.”

Virginia guard Malcolm Brogdon made his first free throw, and after he intentionally missed the second, Wells tipped the ball out of bounds while reaching for the rebound. The Cavaliers ran a lob on the ensuing inbounds play, and Gill finished to tie the score at 64 and send the game into overtime.

The Terps, who lost games in the final seconds against then-No. 8 Duke and then-No. 4 Syracuse in the past month, gathered together before overtime to try to regroup.

“People were sad, almost in tears at that point,” Layman said.

But Turgeon told the Terps to move past the blown lead and urged them to play their best “five minutes of basketball.” The players leaned on each other, too, spurring conversations like the one Allen and Wells had.

Allen sliced into the lane for two layups to open scoring in overtime and give the Terps a four-point lead before Wells hit a jumper of his own when the Cavaliers got close. The Terps defense stiffened and held onto the late lead until a pair of late Virginia air balls sealed the victory.

As the crowd stormed the court, Allen knew he and Wells followed through on their words to each other and rebounded from a near collapse to earn a victory in the final ACC game at Comcast.

“We’ve been in the ACC for a long time,” Allen said. “To go out like that, with a court storming against the top team in the league, you couldn’t ask for a better game than that.”