Police officers were stationed at the ready. Camera phones were held up high. Fans had put on their coats because the time had come to bid farewell. So when the final buzzer sounded and six decades of ACC men’s basketball were finally over for Maryland, the Terrapins faithful flung their popcorn skyward and hurdled over chairs, celebrating with the memories of everything that soon will be left behind.

Over the coming months, Comcast Center will shed its old conference logos and exchange them for Big Ten ones. And really, Maryland could not have scripted a more perfect conclusion in its final ACC regular season game than with a rushed court on senior day in a 75-69 overtime victory over No. 5 Virginia.

“Today wasn’t just an ordinary game,” Coach Mark Turgeon said.

For the Terps (17-14, 9-9 ACC), though, it was very nearly another heartbreaker.

On the verge of closing out the upset in regulation, they bungled three straight offensive possessions. Still, after Cavaliers guard Joe Harris was whistled for an offensive foul with five seconds left, the Terps made the free throws to take a 64-61 lead. Turgeon, seeking to eliminate the possibility of a tying three-pointer, called for his players to foul. But after guard Malcolm Brogdon made his first free throw and intentionally missed his second, the ball was tipped out of bounds off a Maryland player.

When Virginia capitalized on the chance to tie the score on a perfectly executed lob pass and shot by Anthony Gill, Maryland’s lead was gone, overtime loomed and the Terps fans who had been hanging over the railings, ready to storm the court, trudged back to their seats. The announced sellout crowd was quiet.

“Certainly the momentum, you felt, was on our side,” Virginia Coach Tony Bennett said.

So in the huddle before overtime, Turgeon spoke firmly to his players, each of them crushed by the emotional swing that rekindled memories of losses to Duke, Syracuse, George Washington and Connecticut, each by two points or fewer.

“Let’s make this the best five minutes of the year,” he told them, then repeated it several times because he felt the Terps didn’t believe him after how this season had gone. “Let’s make this the best five minutes of the year.”

Point guard Seth Allen took this personally. He curbed his affinity for quick jumpers and decided to attack the basket, scoring two acrobatic layups to begin the bonus period. Later, after four free throws from fellow sophomore Jake Layman (10 points) iced the victory, Allen stood among the revelers and asked someone to pick him up.

“We didn’t want to let this one slip away,” said Allen, who finished with a game-high 20 points. “We took charge as a team. We said we weren’t going to lose. We were determined.”

For the Cavaliers, who were led by Gill’s 15 points and London Perrantes’s 14 (despite a dislocated right pinky finger), the loss ended a 13-game winning streak. Virginia (25-6, 16-2 ACC) will be the No. 1 seed in the ACC tournament, which begins Wednesday in Greensboro, N.C.

In his postgame news conference, Turgeon said the Terps were not just playing for themselves but for all of the history that converged here Sunday afternoon. There was former coach Gary Williams sitting courtside, receiving a standing ovation when he was announced. There was 2002 Final Four MVP Juan Dixon, working as a special assistant on the Maryland bench. There was high-flyer Steve Francis in the stands, wearing the NBA jersey of another Terps star, Len Bias, and joining the current students in their fun at midcourt.

“All those great Maryland players and legends at this university,” Wells said. “We really had that extra motivation.”