CHARLOTTESVILLE, Va. -- When Virginia's two-point conversion put them ahead by one point with just under two minutes to play, Louisville quarterback Lamar Jackson strapped on his helmet and trotted out onto the field as calm as possible.
At that point, he was the Cardinals' only hope to keep their College Football Playoff hopes alive.
Jackson did just that.
The Heisman Trophy frontrunner's 29-yard touchdown pass to Jaylen Smith with 13 seconds left lifted No. 5 Louisville over upset-minded Virginia 32-25 on Saturday at Scott Stadium.
"We took it down and scored in the end, great throw and a great catch," Louisville head coach Bobby Petrino said.
Jackson passed for 361 yards and four touchdowns while adding 90 yards on the ground.
"I thought the communication and the execution was very good," Petrino said of his team's two-minute drive to end the game. "We had to convert a fourth down and it was a great throw in the end.
"I was really proud of Jaylen and the way he made the catch to win the game."
After trailing 17-7 midway through the third quarter, Louisville (7-1, 5-1 in the ACC) reeled off 17 straight points to take a 24-17 lead in the fourth quarter.
Virginia (2-6, 1-3) wouldn't quit however and took a one-point lead with 1:57 left in the game on Kurt Benkert's 4-yard touchdown pass to Doni Dowling and a two-point conversion, but allowed Louisville to march 75 yards in the game's waning moments -- ultimately leading to the Cardinals' game-winning score.
"I like the improvement and what they showed out there today," Virginia head coach Bronco Mendenhall said of his team. "I like their mindset and their focusing on each other and what we could control, not our opponent. They gave us a great chance to win."
The Cavaliers were led by quarterback Benkert, who passed for 238 yards and three touchdowns. Benkert also threw two interceptions that were crucial in the second half.
"The defense did a great job in the first half just keeping us in the game," Petrino said. "Offensively, we weren't very good. We made a lot of mistakes, a lot of critical mistakes.
"The defense kept us in there and when Virginia went and scored in the end, the offense came back. It's what you call a team."
Louisville outgained the Cavaliers 508-322 and was a perfect 4-for- 4 in the red zone.
Wide receiver Jamari Staples led the talented Louisville receiving corps with 120 yards and a touchdown.
Dowling was the bright spot for the Cavaliers' receiving group, as he brought down five passes for 70 yards and two touchdowns.
"This is just the beginning to an entire era, not just a season," Mendenhall said. "We get to play football again next week and we the chance to get better."
With a 27-yard field goal by Sam Hayward early in the first quarter, Virginia became the first team all season to score first against Louisville.
The Cardinals answered by driving 87 yards in 2:14, capping the drive with Jackson passing for a touchdown to Staples.
Louisville held a 7-3 lead with the football but coughed it up in its own territory and the Cavaliers took advantage. Benkert found wide receiver Doni Dowling for a touchdown from nine out to give Virginia a 10-7 lead late in the first quarter.
After Benkert threw an interception deep in Cardinals' territory to give the ball back to Louisville, the Cavaliers sacked Jackson on fourth down to regain possession with 5:28 to play in the half.
Virginia led 10-7 at the half after holding the Cardinals to 261 yards.
Jackson threw for 205 yards with a touchdown and ran for another 37 yards in the first half, but was sacked three times by Virginia.
The Cavaliers totaled only 170 total yards in the first half but held the ball for 17 minutes compared to 13 for Louisville.
NOTES: Virginia is 2-1 all-time against Louisville at Scott Stadium. ... No. 5 Louisville is the highest ranked team to visit Scott Stadium since Oregon in 2013. ... Quarterback Lamar Jackson needs two yards to become the first Louisville quarterback to reach 1,000 rushing yards in a season after tallying 90 yards on the ground on Saturday. ...Jackson has 22 passing touchdowns this season. ... Entering Saturday, Louisville's first quarter point differential was plus-84; it was minus-3 after one quarter against Virginia.