Updated

Given a second chance to celebrate the conclusion of Maryland's final regular-season game in the Atlantic Coast Conference, the fans at Comcast Center swarmed toward midcourt as the final buzzer sounded.

So many times this season, Maryland played well against good teams and ended up losing.

The Terrapins reversed the trend Sunday by beating No. 5 Virginia 75-69 in overtime, and their fans marked the moment with a celebration that was a long time coming.

"Today wasn't just an ordinary game. It was a lot of things," coach Mark Turgeon said. "We always play for Maryland, but today we played for former players, former coaches, all our fans."

After blowing a seemingly secure lead in the closing seconds of regulation, the Terps (17-14, 9-9 ACC) never trailed in the extra session in front of an emotional crowd of 17,950 at the school's final home basketball game in a conference it joined as a charter member in 1953. Maryland will play in the Big Ten next season.

"It was great," forward Evan Smotrycz said. "Obviously, we felt like we were playing for something bigger than ourselves. A lot of people had a lot invested in this game and wanted to see us win and finish off the ACC the right way."

Earlier this season, Maryland lost to Pittsburgh by four points, fell at Duke by two points, lost to Syracuse by two and dropped a double-overtime decision at Clemson. So when Virginia used an improbable comeback to force overtime, Turgeon couldn't help getting a familiar feeling.

"The stuff we've been through, it's been tough," Turgeon said. "But it's made us a lot tougher for the future."

Seth Allen scored five of his 20 points in overtime and Dez Wells finished with 18 for the Terrapins. Maryland had lost six straight to Virginia, including a 61-53 decision in February that was part of the Cavaliers' school-record winning streak against ACC competition.

After the final buzzer sounded, thousands of fans raced onto the court to celebrate another unforgettable ACC memory at the expense of one of its biggest rivals.

Anthony Gill scored 15 points and London Perrantes had 14 for Virginia (25-6, 16-2), which had already clinched the No. 1 seed in the ACC tournament and was vying to set an ACC record for most league wins during the regular season.

"Not that we felt we're invincible, but now we know we aren't," coach Tony Bennett said. "So now we address it, and now we get after it."

The end of regulation was a horror show for Maryland.

After Jake Layman made two free throws with 4.1 seconds left to put the Terrapins ahead 64-61, Maryland quickly fouled. Malcolm Brogdon made the first free throw and intentionally missed the second before the Terrapins swatted the ball out of bounds with 1.7 seconds to go.

Gill caught the inbounds pass in the lane and dropped in an uncontested jumper to force overtime.

"Our guys were down. I was down," Turgeon said. "I said, 'Let's make this the best five minutes of the year.' They didn't believe me the first time I said it. But I said it 15 times during the timeout."

Overtime began with Allen making two straight layups for a 68-64 lead. The guard then blocked a shot before adding a free throw.

The Cavaliers used a layup by Gill to close to 71-69 with 1:13 left, but they would not score again. Despite the loss, Virginia will head into the ACC tournament as a top seed for only the second time.

"I feel like we just need to get back in practice and just get back to what we know — and that's defense and not letting people penetrate," Gill said.

Maryland opened the second half with an 11-2 run, turning a one-point deficit into a 45-37 lead.

After Wells made two free throws, Perrantes answered with a foul-line jumper. Wells then made a basket and added two foul shots before Allen popped a 3-pointer and Shaquille Cleare added a layup.

The teams combined for only two field goals over the next 5 minutes, but Virginia made five free throws during that span to close to 47-44 with 11:34 left.

Minutes later, Joe Harris hit a 3-pointer to end a 6-0 spree that put the Cavaliers in front 52-51 with 8:30 to play. Maryland went ahead 62-58 with 2:39 remaining but could not make the lead stand up.

Perrantes scored 12 first-half points on four 3-pointers, including one in the closing seconds that put the Cavaliers ahead 35-34.

As an expression of gratitude to the lone senior on the squad, Turgeon started seldom-used forward John Auslander, who missed his only shot before being replaced with just under 4 minutes elapsed.