Late in Maryland’s game last night against Virginia — with the score tied, with the pressure palpable — the Terrapins faced a choice: Play like you belong in the NCAA tournament for the 11th straight year, or pack it in.

Pretty easy decision.

“Who wants to be remembered as a loser?” point guard John Gilchrist said. “When you lose, you’re easily forgotten. We knew what was on the line, and we just made it happen.”

It didn’t matter how it looked, and once again, it was no thing of beauty.

But it happened. The Terps got 20 points from guard Chris McCray, a superior defensive effort and some clutch free throw shooting in the final minutes to pull out a crucial 70-61 victory in front of 17,950 relieved fans at Comcast Center.

The result pushed the Terps (16-11, 7-9 ACC) — who have played one of the toughest schedules in the nation — to the brink of a berth in the NCAAs. And it was damaging for the Cavaliers, who had been the hottest team in the ACC, yet shot just 33.9 percent from the field. Center Elton Brown led the way with 16 points, but guard Todd Billet -- the hero of Virginia’s late-season run — missed all 10 of his three-pointers, and the Cavs frittered away an 11-point second-half lead.

The Terps finished the regular season by winning consecutive ACCgames for just the second time all year. More important, they gained the sixth seed in the ACC tournament, and will face third-seeded Wake Forest in the quarterfinals at about 9:30 p.m. Friday in Greensboro, N.C. The Demon Deacons, who finished tied with Georgia Tech for third — and had the exact same record against every team in the league as the Yellow Jackets — won a coin flip last night to break the tie. Georgia Tech will be seeded fourth and face fifth-seeded North Carolina in the quarterfinals.

Virginia (16-11, 6-10) lost for just the second time in six games, finished eighth in the ACC, and will face ninth-seeded Clemson in Thursday night’s play-in game at the conference tournament. The winner will advance to play top-seeded Duke Friday.

Worse for the Cavaliers, though, is that they likely have to beat Clemson and Duke to fight their way into the NCAA tournament.Virginia doesn’t have a quality nonconference win, and was likely doomed by a five-game losing streak last month.

“It’s tremendously disappointing,” Coach Pete Gillen said.

Considering everything that was at stake -- seeds in the ACCtournament, possible berths in the NCAAs -- the teams were remarkably flat through a sloppy, poor-shooting first half. Virginia missed 22 of its first 27 shots from the field, yet still led 34-27 at the break.

“Halftime,” Maryland Coach Gary Williams said, “was interesting.”

When Virginia guard J.R. Reynolds opened the second half with consecutive buckets, Williams called time out just 47 seconds into the second half, with the Terps down 38-27.

“I could just see the look,” Williams said. “I was just trying to change the body language of our team. We had nothing to say about X-and-O’s in that timeout. It was just: We have to put it out there on the court. We’re too good to play like that.”

So they played better. The Terps went on an 11-2 run, holding Virginia without a field goal for just more than seven minutes. With 10:45 remaining, guard D.J. Strawberry scored from the lane, and Maryland -- finally -- led 44-42. When McCray scored three straight Maryland buckets, the lead grew to 52-44 with 7:30 left. Yet Virginia wouldn’t go away and when Brown scored underneath with 4:30 left, the game was tied again, 57-57.

“We just looked at each other,” forward Nik Caner-Medley said, “and said, ‘We have to stay together.’ “ 

They did. They got aggressive, took the ball inside, and made their free throws. Jamar Smith -- a 43-percent free-throw shooter -- broke the tie with 4:06 left, and Gilchrist snared the rebound of a miss and then hit two. Buckets by Strawberry and McCray made it 64-57 with 2:16 left. And when Virginia pulled to 64-61 with 39 seconds left, Smith hit the first of two free throw attempts with 38 seconds remaining, then grabbed the rebound when he missed the second.

“He hasn’t made them all,” Williams said, “but he’s made some big ones.”

With the game finally out of reach -- and with eight of their final 10 free throws through the net -- the Terps celebrated. Williams, who is not given to smiley displays of emotion, jumped up and down repeatedly, his feeling of accomplishment apparent.

“It’s just happiness,” Gilchrist said. “You’re this happy when you work this hard. If someone just gave it to you, you ain’t going to be that excited. But we worked our butts off in here.”