BLACKSBURG, Va. (AP) Michael Brewer kept getting knocked to the turf, kept getting up, and would not let Virginia Tech lose.
The quarterback, maligned much of this season for inexplicable interceptions, threw a 9-yard touchdown pass to Bucky Hodges with 1:48 remaining Friday night and Virginia Tech beat Virginia for the 11th year in a row, 24-20.
''We knew that this would be a tough one, that we would have to kind of ride the waves to get through this,'' Brewer said after throwing for 235 yards and two touchdowns. ''They were good defensively and they were able to get pressure on the passer. They've done it to everybody all year, so I knew I was going to take some shots, but it was one of those deals where as long as we could get back up and keep moving forward and not shoot ourselves in the foot, we'd be all right.''
Once the Hokies (6-6, 3-5 Atlantic Coast Conference) sacked Matt Johns on fourth down, their second victory in six games was secured, and qualified them for a bowl game for the 22nd year in a row. Only Florida State, with 32, has a longer run. They also ended a six-game losing streak at Lane Stadium against conference opponents.
The touchdown pass to Hodges came three plays after he and Brewer hooked up for a 50-yard catch and run.
''With the coverage that they rolled to at the snap of the ball, I knew that Bucky was going to be one on one and obviously we like that matchup,'' Brewer said. He finished 15 of 33 with one interception, one sack and was hit plenty.
''It was one of those deals where, you know, it's senior night. It was the seniors' last game in Lane Stadium and I was going to make sure that I did everything that I possibly could to make sure that we sent them out on the right note,'' he said.
Virginia (5-7, 3-5), seeking its first bowl bid since 2011, lost its 10th consecutive road game. The Cavaliers drove to the Hokies' 36 in the closing seconds, but Johns was thrown for an 8-yard loss after rolling to his right looking downfield.
The game was a defensive struggle throughout, and only in the closing minutes did the offenses get moving.
The Hokies' go-ahead drive, which took just five plays and involved a foolish penalty against the Cavaliers, came after Greyson Lambert had led Virginia on an 89-yard march and a 20-17 lead.
Starting from his own 25, Brewer was flushed and threw the ball away, but got hit and knocked down by lineman Mike Moore after releasing the ball, drawing a 15-yard roughing the passer penalty and an automatic first down. Brewer hit Hodges for 50 yards on the next play, and for the touchdown after a false start penalty against the Hokies.
''It was definitely shocking,'' linebacker Max Valles said of the winning score. ''I felt like the way we were playing all day we could have just gone out there and got a stop. I'm very disappointed in the defense. It's on us.''
Virginia Tech finished with 433 yards, the most allowed by the Cavaliers this season. Virginia gained 314.
Lambert, who rarely looked comfortable all game, finally did in leading the Cavaliers on an 89-yard drive for the go-ahead touchdown. Using almost all short passes, he completed seven in a row, the last a 20-yarder to his roommate, Zach Swanson, to give Virginia a 20-17 lead with just 2:55 remaining. Lambert was 15 of 32 for 211 yards with an interception.
The Hokies had taken a 17-13 lead late in the third quarter when Brewer, hit repeatedly and at times wobbly, found Cam Phillips for 36 yards and a touchdown to finish off an 83-yard drive. Phillips got behind DreQuan Hoskey on the play.
Virginia led 13-10 at halftime despite doing very little on offense. The Cavaliers gained a total of 124 yards in the first half, and 40 came on a run by Kevin Parks, and 54 came on a pass from Lambert to Taquan Mizzell.
Parks' run gave Virginia a first down at the Hokies' 17, and they settled for a 40-yard field goal by Ian Frye. Mizzell's catch and run set them up at the 6, and led to Frye's 21-yard field goal.
Their only touchdown came when Brewer was hit while trying to pass from his end zone, and the ball popped up and into Dean's arms, and he returned the interception three yards for the TD.
The Hokies did their scoring in similar fashion, using a 69-yard drive that featured a handful of plays with Brenden Motley running the wildcat to lead to Joey Slye's 22-yard field goal. C.J. Reavis later blocked Alec Vozenilek's punt from the end zone and Bucky Hodges recovered it for a touchdown, the second blocked punt touchdown against Virginia in as many games.
Follow Hank on twitter at: http://twitter.com/hankkurzjr