Justin Bibbs drives to the basket against Virginia. The Hokies upset a ranked Virginia team for the second consecutive season. (Matt Gentry/(ap Photo / The Roanoke Times, M)

Virginia Tech senior point guard Seth Allen wanted a home-court win over rival Virginia so badly that he was willing to infiltrate a Cavaliers huddle for it.

As the Hokies’ Justin Bibbs lined up to take free throws with 47 seconds left in the first half and Virginia Tech down 11, Allen slunk over to Virginia’s bench unnoticed and leaned in, eavesdropping while Virginia Coach Tony Bennett drew up a play for freshman guard Kyle Guy. Allen then walked back to the Hokies’ bench to have a word with Coach Buzz Williams.

Allen’s spying was for naught; Bibbs missed both free throws and Guy sank a three-pointer on the next possession. Still, the impassioned senior point guard found another way to end the night a hero. With three seconds left in double overtime, Allen drove to the basket, pump-faked to get his defender in the air and slid in a layup to lift Virginia Tech past No. 12 Virginia, 80-78 . The win got the Hokies back to the .500 mark in ACC play and kept the Cavaliers from sharing the top spot in the conference with No. 8 North Carolina.

“I have a great relationship with Coach Bennett and some of the Virginia players. I wasn’t trying to be disrespectful at all. I heard them talking about a ball screen or something. I can’t even remember,” Allen said. “It was just that important of a game.”

Allen turned in a team-high 20 points to help the Hokies (17-7, 6-6) beat a ranked Virginia team in Blacksburg for the second straight season. Virginia Tech also earned its second win over a ranked team this season, with the other an 89-75 victory over then-No. 5 Duke, which was playing without Grayson Allen, on New Year’s Day.

The win also comes less than two weeks after the Hokies lost to the Cavaliers, 71-48, in Charlottesville on Feb. 1.

“It’s a rivalry. When we lost, everybody was telling me, ‘You got to get them in 10 days,’ stuff like that,” Zach LeDay said. “The fact that they’re a ranked team helps as well. We got to get some wins on the road, keep on building them road wins up, and we’ll be able to get a higher seed as the season goes along.”

Seth Allen wouldn’t have had a game-winning shot without help from the other star point guard on the floor, London Perrantes. The Cavaliers’ senior leader had a chance to be the hero himself when he drove for the go-ahead layup with 17 seconds left in the first overtime and the game tied at 68, but in a stupefying turn of events, the ball got stuck on the back of the rim.

“I couldn’t do that if I tried it again,” Perrantes said. “Never done that, never seen it happen — especially on a layup. Yeah. That was a tough one.”

Said Allen: “ That was crazy. I haven’t seen anything like that.”

Perrantes led four Virginia players in double figures with 22 points on 7-for-22 shooting. Guy added 12, Marial Shayok had 11, and Devon Hall had 10. The Cavaliers (18-6, 8-4) suffered at the free throw line again — they made 5 of 9 in overtime, while Virginia Tech was 7 for 8 in the same stretch — and now turn around to face Tobacco Road’s finest later this week.

Duke visits Charlottesville on Wednesday, and Virginia plays North Carolina on the road Saturday.

The last time Virginia and Virginia Tech played, the Cavaliers swatted the Hokies, barely breaking a sweat. This time, in front of their home crowd, the Hokies dove for every loose ball.

Down 14 at halftime, Virginia Tech started the second half with a 10-2 run thanks in part to LeDay’s first four points of the game on a pair of free throws and a jumper. Virginia Tech had whittled the Cavaliers’ halftime lead to four with just over 12 minutes to play and kept it within single digits for the final 16 minutes.

“We didn’t even look at the scoreboard,” Allen said. “Just on the sidelines saying, ‘Take it one possession at a time, one possession at a time.’ ”

The Hokies righted themselves after a first half in which Virginia dominated after jumping out to a double-digit lead just 10 minutes in. None of the Cavaliers starters even were on the floor when a pair of true freshman guards — Ty Jerome feeding Guy for a three-pointer — put the Cavaliers up 17-6.

After Virginia went up 19-9 a possession later, guard Justin Robinson, who received a technical at Virginia Tech’s previous game for shoving an official, launched the ball into the barricade separating fans from the court and urged his teammates for more effort.

After that, the Hokies put their energy to more constructive use and rattled off 13 points in five possessions, including three three-pointers from Allen.