CHARLOTTESVILLE, Va. (AP) Henry Coley thought he had cost Virginia an upset of No. 21 Louisville.
And then, the Cavaliers got another chance.
''It was magical,'' Coley said of a fumbled punt by Louisville that Kelvin Rainey recovered at the Louisville 25. Four plays later, Ian Frye's 42-yard field goal lifted the Cavaliers to a 23-21 victory over the Cardinals.
Virginia (2-1, 1-0) ended an 11-game Atlantic Coast Conference losing streak and a 10-game skid against FBS-level competition. The Cardinals (2-1, 1-1) had won seven straight road games.
''This is one of the most emotional games I've ever had,'' said Coley, a senior linebacker. ''I'm in the locker room crying after the game. ... I've never cried over a football game. It was emotional because it was something big lifted off my shoulders.''
Twice in the fourth quarter, penalties against Coley kept Louisville drives alive, and each finished with a touchdown, helping them erase a 20-7 deficit. The second TD came with 6:59 to play, and Virginia got one first down on the ensuing possession, and then punted.
As James Quick settled under it for the Cardinals, a teammate bumped him and the ball came loose.
''It's about time it happens to somebody else,'' Virginia coach Mike London said.
Louisville coach Bobby Petrino said the fumbled punt didn't cost his team the game.
''When you lose a game like this, we will watch the video and there will be 15 plays, individually, that if we would have made that play, we had a chance to win the game,'' Petrino said. ''We just didn't make enough plays to win the game.''
Before the fourth quarter, the Cavaliers controlled the game. Greyson Lambert threw for a touchdown and ran for another score, and Frye had two earlier field goals before Louisville put starting quarterback Will Gardner back in the game.
Gardner, lifted in favor of more mobile freshman Reggie Bonnafon, led consecutive touchdown drives. He hit Keith Towbridge for 28 yards on one third down play, and got help from a pass interference call on Coley to convert a third-and-8 play. Dominique Brown ran it in from the 6 three plays later to make it 20-14.
After a three-and-out for Virginia, the Cardinals drove again with a huge assist from the Cavaliers.
On third-and-goal from the 9, Gardner had Coley and defensive end Eli Harold converging on him when he threw the ball right into the arms of linebacker Max Valles for an interception. But Coley and Harold both gave Gardner a shove after he got rid of the ball, and Coley was called for roughing the passer.
Gardner then found James Quick for a 4-yard TD pass on the next play for a 21-20 lead, quieting the crowd at Scott Stadium until the punt, the scrum and the emergence of Rainey with the ball, already in Frye's field-goal range.
''We're figuring out how to win again,'' Coley said.
It was Virginia's first victory against a ranked team since a 14-13 win at Florida State on Nov. 19, 2011.
Lambert played most of the way for Virginia, hitting Miles Gooch for a 15-yard touchdown to tie it at 7, and scoring on a 10-yard run to give the Cavaliers a 17-7 lead in the third quarter.
Frye's 47-yard field goal made it 20-7, but then Louisville came back.
Gardner's first interception of the season set Virginia up with a short field in the first quarter. Anthony Harris made the pick, giving the Cavaliers the ball at the 15. Three plays later, Lambert hit Gooch for the score. It gave the Cavaliers 38 points after turnovers this year; last year, they had 13.
The Cardinals took the opening kickoff and drove right down the field. Gardner had completion of 11 yards to James Quick, 20 yards to Eli Rogers and 9 yards to Kai De La Cruz. The latter set up a fourth-and-1 from the Virginia 9, and Gardner hit Charles Standberry for the touchdown off a play-action fake.
Follow Hank on twitter at: http://twitter.com/hankkurzjr