Nickeil Alexander-Walker of Virginia Tech shoots over Virginia’s Isaiah Wilkins during Saturday’s upset. (Ryan M. Kelly/Getty Images)

Virginia’s quest for perfection in the ACC came to a jarring end Saturday night. All the more dispiriting for the second-ranked Cavaliers was the loss came against contentious in-state rival Virginia Tech, which rallied in overtime, 61-60, at raucous John Paul Jones Arena.

Virginia had its 15-game wining streak snapped and likely lost a chance to ascend to No. 1 in the rankings for the first time since December 1982.

The Cavaliers (23-2, 12-1) still hold a two-game lead in the ACC over second-place Clemson, which they beat in the teams’ only meeting, with five games left in the regular season but failed to sweep the season series in the Commonwealth Clash.

The Hokies, meanwhile, secured a signature victory in front of an announced crowd of 14,623 that’s certain to boost their NCAA tournament profile. And they accomplished it by overcoming a five-point deficit in the final 39 seconds of overtime.

Kerry Blackshear Jr.’s putback with 5.8 seconds to play produced the final margin in the Hokies’ fifth win in six games. Virginia Tech (18-7, 7-5) was able to celebrate officially when Ty Jerome’s deep three-pointer missed, dealing the Cavaliers their first loss since Dec. 5 at West Virginia.

“I say it with 100 percent sincerity. It’s just who our kids are,” Coach Buzz Williams said of the Hokies’ first road victory over a ranked opponent this season. “There’s multiple [games] where we could have just stopped or quit or splintered apart. It’s the togetherness of those kids.”

The first momentum swing in overtime tilted toward Virginia, which took a 54-51 lead with a 5-0 burst that included De’Andre Hunter’s three-point play. But the Hokies came right back to tie when senior guard Justin Bibbs swished a three-pointer from the left wing with 2:27 to go.

Devon Hall’s three-pointer put Virginia ahead 57-54, and the margin grew to 59-54 when Isaiah Wilkins made both ends of a one-and-one. The Hokies then clawed to 60-59 with 20 seconds remaining on Blackshear’s layup and a three-pointer from Justin Robinson.

With 13 seconds to go, Hall missed the front end of a one-and-one, and Blackshear collected the rebound off Robinson’s missed layup before scoring on the follow while drawing a foul.

“I shoot tons of free throws every day, so it’s frustrating,” said Hall, who had a team-high 16 points but made only 1 of 3 from the foul line. He entered shooting 93.4 percent from the line.

Also troubling was the Cavaliers’ wayward shooting from three-point range, where they went 11 for 38, including 1 for 5 in overtime. Jerome and guard Kyle Guy, Virginia’s third starting guard, combined to go 4 for 24 (17 percent) from beyond the arc.

In a game of steep momentum swings, Virginia erased a four-point deficit in the final 1:19 of the second half to force overtime. Jerome made both baskets for the Cavaliers, and the sophomore had a chance at the game-winner with a three-pointer from NBA distance — well within his range — but the shot bounced off the front iron as the buzzer sounded in regulation.

Trailing by seven at halftime, Virginia made three straight three pointers during 9-0 flurry that tied the score at 35. Hall made two, including a contested shot over Devin Wilson, and Jerome had the other. Jerome then had an open look at a three-pointer for the lead but missed off the front rim.

“We almost stole that game, but that’s what it would have been, stealing that game,” Cavaliers Coach Tony Bennett said. “They outplayed us. I think there were too many breakdowns for us and miscues.”

Virginia Tech capitalized on those to author an outcome vastly different from the last meeting between the schools separated by roughly 120 miles. The Hokies lost, 78-52, at Cassell Coliseum, surrendering Virginia’s highest point total in an ACC game.

It was the fewest points Virginia Tech has scored this season, although the Hokies reeled off six wins in their next nine games to remain in the hunt, albeit precariously, for a second straight NCAA tournament berth.

The Cavaliers were ranked eighth at the time and only in the nascent stages of becoming a team many analysts consider a favorite to reach its first Final Four under Bennett, who has endured his share of disappointment in the NCAA tournament.

In 2016, for instance, Virginia, seeded first in the Midwest, failed to protect a 12-point lead in the second half and lost to No. 10 seed Syracuse, 68-62, in the regional finals in Chicago. The Cavaliers also were a No. 1 seed in 2014 and lost to fourth-seeded Michigan State, 61-59, in the round of 16.

Despite the loss, Virginia remains on track for yet another No. 1 seed this season with perhaps the most complete résumé in the country.

The Cavaliers’ signature win came against then-No. 4 Duke on Jan. 27 at Cameron Indoor Stadium, Virginia’s first win there since 1995. They also have a half dozen other Quadrant 1 triumphs under a new formula the NCAA tournament selection committee is using to evaluate a team’s profile.

The Hokies’ aspirations to join Virginia in the NCAA tournament received a jolt with their second Quadrant 1 win. Additionally, they will have ample opportunity to further their case with games left against Duke, Clemson and Miami, all among the RPI top 20, as well as in the ACC tournament.

“I just hope we handle it in the right way,” Williams said. “The margin in this league is unlike anytime since I’ve been here. Just everybody is beating up everybody. We just started a very difficult stretch. I think we play three of the top 15 teams over a 10-day period, so thankful for the start. We’ll have to be very mature in how we handle it going forward.”