Terrell Stoglin scores 21 of his game-high 28 points in the second half as Maryland ends a three-game losing streak while dropping Virginia Tech into the ACC’s basement. (John McDonnell/The Washington Post)

After manhandling Virginia Tech with terrific first-half defense, Maryland managed to turn a game without a single lead change into riveting theater Saturday at Comcast Center. In the end, the Terrapins made just enough free throws to fend off a furious Virginia Tech rally for a 73-69 win that was closer than it should have been.

But it was a victory nonetheless, one Maryland needed badly to snap three-game losing streak and nudge the Terrapins (13-7, 3-3) back to .500 in ACC play heading into Wednesday’s road game at Miami.

“Up until the 38-minute mark, we were as good as we’ve been all year,” Maryland Coach Mark Turgeon said, noting his team’s double-digit lead through much of the game and its suffocating first-half defense, in which the Hokies scored just 19 points. “But true to course, the way we are, we had to make it interesting.”

Among the notable plot twists: A controversial flagrant foul called on Maryland senior guard Sean Mosley that whipped the crowd of 16,796 into a frenzy; Mosley’s three clutch free throws with 1 minute 10 seconds remaining after he was fouled on a long-range shot; Virginia Tech scoring 11 points in the final 35 seconds; and a game-high 28 points by sophomore guard Terrell Stoglin, whose formidable will to win overshadowed yet another performance with zero assists.

In all of this — the sometimes selfish offense, the defense that veered from super to subpar — Turgeon saw positives, mindful of how far his Terrapins have come since the season began with only seven scholarship players, little experience and even less confidence.

Virginia Tech guard Erick Green, left, scores over Maryland Terrapins forward Ashton Pankey. (John McDonnell/The Washington Post)

“We’re heading in the right direction,” Turgeon said. “We’re really coming together.”

The woes for Virginia Tech (12-9, 1-5), however, continue to mount. The Hokies have now lost six of their past seven — all but one by four points or less.

Maryland seized the upper hand quickly, with Ashton Pankey (eight points, 11 rebounds) hitting his first shot and hitting the boards hard, too.

The Hokies, meanwhile, made just three field goals through the first seven minutes — all by junior Erick Green (team-high 18 points).

Hoping to jump-start his team, Hokies Coach Seth Greenberg shuffled his starting lineup, replacing highly touted freshman Dorian Finney-Smith, mired in a shooting slump, with 6-foot-9 forward Cadarian Raines.

And for the second consecutive game, Turgeon brought 7-1 center Alex Len off the bench, hoping it would take some pressure off the freshman, who has struggled of late.

Stoglin misfired on his first few jumpers and was summoned to the bench for his poor shot selection. But with Mosley making tough shots, Maryland took a 32-19 lead to the break, having held the Hokies to just six field goals in 25 attempts in the first half.

Maryland Coach Mark Turgeon is shown during the Terrapins’ defeat of the Virginia Tech Hokies. (John McDonnell/The Washington Post)

After taking a 15-point lead, Maryland gave up eight unanswered points, with the Hokies’ Dorenzo Hudson (14 points) hitting successive three-pointers.

Virginia Tech pulled within six, 40-34, but Stoglin scored 11 of the Terrapins’ next 14 points, including back-to-back three-pointers.

It was a 10-point game (60-50) with 3:56 remaining. That’s when the Terrapins’ defensive lapses began, and the Hokies replied with layup after layup.

After two squandered Maryland possessions, Mosley got a huge block but was soon called for a flagrant foul. Moments later, his 3-for-3 performance on the free throw line put Maryland up 66-58.

The Hokies eventually reeled off eight straight points, and Green’s layup made it a one-possession game, 69-66, with 10 seconds to play. But guard Pe’Shon Howard and Stoglin converted all four of their free throw attempts to seal the win.

Still, there was plenty for Turgeon to quibble about, had he been in a quibbling mood. Maryland had just seven assists and turned over the ball 16 times. Stoglin contributed zero assists (but shot 21 times) and committed five turnovers.

Said Greenberg: “Stoglin, he plays for both teams. The guy made tough, tough shots, but he also [took] some shots that gave us a chance to get back in the game. But when he’s making those tough shots, especially the guarded ones, you hope that’s your chance to win the game.”