Joshua Stanford (6 catches, 88 yards, one touchdown) and the Hokies stare down their critics and rebound from a two-game losing streak to overpower the Hurricanes. (Mike Ehrmann/Getty Images)

Facing third and 12 at midfield and nursing a precarious 11-point lead late in the third quarter on a rainy Saturday night, momentum hung in the balance for Virginia Tech. But what followed could become a thing of legend if the Hokies’ 42-24 victory over No. 14 Miami propels them to another ACC championship game next month.

Quarterback Logan Thomas, who had his helmet knocked off on the previous play and would have had to leave the game if not for a timeout called by Coach Frank Beamer, delivered a pass to wide receiver Willie Byrn, who was wide open over the middle. Byrn proceeded to race 48 yards down the field before Miami’s Ladarius Gunter poked the ball out from behind. Except the bouncing fumble fell into the waiting hands of sophomore Demitri Knowles in the end zone for a touchdown.

The saying goes that it’s better to be lucky than good. On this night, Virginia Tech’s offense was lucky and good.

Buoyed by three Miami special teams gaffes and a cavalcade of lucky breaks, the Hokies stated loud and clear they will not let the ACC’s Coastal Division crown slip away without a fight.

Running back Trey Edmunds finished with 74 rushing yards and became the first Virginia Tech player to score four touchdowns in a game since 2009. Thomas, meanwhile, answered the critics who called for his benching this week, completing 25 of 31 passes for 366 yards and two touchdowns.

“He just confirmed he’s the most resilient guy I’ve ever met,” Byrn said of Thomas.

After the game, Beamer revealed that he met with Thomas on Thursday to remind the redshirt senior he didn’t need to defend himself because “what you’ve done here speaks for itself.”

“I’ve never seen him flinch,” Beamer said. “Through the good, through the bad he’s been the same guy.”

It’s the first time in Thomas’s career he has thrown for more than 300 yards in consecutive games, and the first time under Beamer that a quarterback has accomplished such a feat. Perhaps more importantly, Thomas committed no turnovers and came through whenever Virginia Tech (7-3, 4-2 ACC) needed a big play.

Following Byrn’s fortuitous catch-and-run, Miami (7-2, 3-2) trimmed its deficit again with an 84-yard touchdown pass to Allen Hurns. But Thomas and Edmunds wouldn’t relent on Virginia Tech’s ensuing possession.

On a 75-yard march down the field, Thomas completed 4 of 5 passes, including two third-down conversions, and Edmunds rushed for 23 yards. Edmunds capped the sequence with a four-yard touchdown run and Miami fans began streaming for the exits.

As a team, the Hokies gained a season-high 546 yards. Wide receiver Josh Stanford and Byrn finished with 107 and 105 yards receiving, respectively.

The win means Virginia Tech, Miami, Georgia Tech and Duke all have two conference losses this season. If the Hokies win their final two games against Maryland and Virginia and Duke loses one of its final three games, Virginia Tech would earn its third Coastal Division title in four years.

Saturday was the program’s first road win over a top 15 opponent as an unranked team since 1989, and just the second in school history.

“I think those colors bring out the best in a player,” Thomas said about Miami, whom he also torched at Lane Stadium back in 2011.

The evening got off to an ominous start when freshman wide receiver Stacy Coley helped the Hurricanes race to a 7-0 lead, turning a routine screen play into an 81-yard touchdown catch on Miami’s second offensive play of the night.

From there, though, all the breaks went Virginia Tech’s way. In just the first quarter, the Hokies turned two fumbles on long Miami kickoff returns into touchdown runs by Edmunds.

The first came when sophomore punter A.J. Hughes’s helmet knocked the ball out of Coley’s hands on a textbook form tackle, and linebacker Tariq Edwards recovered it near midfield. On the Miami’s next return, wide receiver Allen Hurns was in the midst of another lengthy run when Hokies linebacker Derek DiNardo caused and recovered another fumble.

On Virginia Tech’s ensuing possession, wide receiver Josh Stanford fumbled on a 13-yard reception, Coles recovered the ball at the 2-yard line after a scramble.

In the second quarter, officials ruled Miami punter Pat O’Donnell’s knee touched the ground while catching a snap and Virginia Tech regained possession at the Hurricanes 17-yard line. Edmunds, playing in the stadium where his father, former Miami Dolphins tight end Ferrell Edmunds once starred, took care of the rest, scoring his third touchdown of the game to give Virginia Tech a 21-7 lead.

“Just our night,” Beamer said.

Thomas set a new school record for career passing touchdowns (50) on his second-quarter scoring pass to Joshua Stanford and Virginia Tech entered halftime with a 28-14 lead, the most points it has scored in a first half since a season-opening win over Appalachian State in 2011.

That, as it turned out, was enough to secure a crucial Coastal Division win.