CHARLOTTESVILLE — On a damp and gloomy Saturday afternoon at Scott Stadium, the smiles on the face of Virginia football coach Bronco Mendenhall and his players could not have shined any brighter.

Knowing that they had to win six games to become bowl-eligible and not sure how they would get there, the Cavaliers rallied from a 15-point third-quarter deficit and defeated Georgia Tech 40-36.

After losing their two previous games and unlikely to be favored again, Virginia (6-3, 3-2) came from behind on three occasions, taking the lead for good on a 27-yard touchdown pass from Kurt Benkert to Andre Levrone with 1:22 remaining.

Georgia Tech (4-4, 3-3) subsequently got as far as the Virginia 32-yard line before a hurried last-ditch pass by Taquon Marshall went incomplete on fourth-and-15.

The Yellow Jackets entered the game as 7½-point favorites, although they had gone 2-10 at Scott Stadium since 1990.

After going on a four-game winning streak, Virginia had lost its two previous games in rather ignominious fashion, losing to Boston College 41-10 at Scott Stadium before dropping a 31-14 decision at Pittsburgh.

Mendenhall had pledged to take a different approach with his players, not avoiding discussion of the sixth win required to play in a bowl.

“They decided that they wanted to be different and play different than they had the last two weeks,” he said. “There were plenty of chances for it to go any direction [in] this game and they just kept coming back.”

After a 92-yard Joe Reed kickoff return trimmed an early Georgia Tech lead to 14-13 at the half, the Yellow Jackets jumped on UVa to start the third quarter.

Only 35 seconds had expired before the Yellow Jackets had scored twice — on a 78-yard run by quarterback Taquon Marshall and a resulting 27-yard interception return for a TD by Bruce Jordan-Swilling on the first play after the kickoff.

It was the seventh interception return for a touchdown by a Virginia opponent over the past two seasons, six of them yielded by Benkert.

That resulted in “an even more intense focus that the team needed me,” Benkert said. “We were still in the game. There was still a lot of time left.”

Just as quickly as Georgia Tech had gone up by two scores, Virginia scored twice in the span of 94 seconds on Benkert touchdown passes to Levrone and Doni Dowling.

A.J. Mejia’s second field goal of the game and a safety when Georgia Tech’s Marshall was tackled in the end zone capped a 20-0 UVa run and it seemed UVa had all the momentum at that point. However, Georgia Tech wasn’t done.

Marshall connected with Ricky Jeune on a 33-yard touchdown pass to put the Jackets back on top, 36-33, with 3:10 left. Virginia had plenty of time to mount one last drive but they almost did it too quickly.

There was 1:22 on the clock when the Cavaliers regained the lead on Levrone’s second TD reception, and Georgia Tech definitely threatened, with Marshall completing a 35-yard pass to Jeune on fourth-and-16.

The Yellow Jackets had first-and-10 at the UVa 29-yard line with 29 seconds left but got no further.

“Give Virginia credit,” Georgia Tech coach Paul Johnson said. “They made plays when they had to make plays. We made way too many mistakes to win. Special teams were a killer. I am at a loss. You can’t work on it harder than we work on it.”

UVa’s Reed, who had a 69-yard kickoff return against Pittsburgh one week earlier, had a 57-yard return on the opening kickoff Saturday that led to a Mejia field goal that opened the scoring.

Mendenhall said that Reed and punter Lester Coleman were both “a huge influence” on the game. Coleman averaged 46.0 yards on eight punts, four of which were downed inside the Georgia Tech 20-yard line.

Georgia Tech outgained the Cavaliers 399-357, reversing a process during which UVa lost games by two touchdowns when it outgained both Indiana and Boston College.

Benkert completed fewer than 50 percent of his passes in what has become something of a trend, but he now has thrown 20 touchdown passes in eight games. One more TD pass would move him into a tie for second behind Matt Schaub, who had 28 in 2002.

“Kurt Benkert down their stretch was exceptional [with] the throws he was making and the connections we were making on the big plays,” Mendenhall said.

“I might be happiest for him [but] really liked the resiliency of our team and what they earned today in terms of a chance to keep playing.”