MIAMI GARDENS, Fla. (AP) — N’Kosi Perry threw for a touchdown on the opening drive and ran for another with 2:31 remaining, and Miami knocked off No. 20 Virginia 17-9 on Friday night.

Deejay Dallas caught the touchdown pass for Miami (3-3, 1-2 Atlantic Coast Conference), plus rushed for 63 yards on 13 carries. Pat Bethel blocked a field goal for Miami and K.J. Osborn caught four passes for 60 yards.

Perry finished 16 of 27 for 182 yards. The win kept the Hurricanes from falling to 0-3 in conference play — any conference — for what would have been the first time in school history.

Bryce Perkins connected on his first nine passes and finished 24 for 41 for 244 yards for Virginia (4-2, 2-1). The Cavaliers entered ranked, yet were still 2 1/2 point underdogs at kickoff.

And apparently, those oddsmakers saw this coming.

Brian Delaney made three field goals for the Cavaliers, who were looking for their first 3-0 start since 2007. They’re now tied with North Carolina for first place in the Coastal Division, and could be joined there by Duke if the Blue Devils beat Georgia Tech on Saturday.

Miami went 78 yards in 11 plays on the game’s first possession, with Dallas taking a short pass from Perry and rumbling the rest of the way for a 17-yard score. Perry was under pressure, wound up flipping the ball to Dallas — who caught it well behind the line of scrimmage, but ended up darting into the right side of the end zone.

The Hurricanes’ next six drives went nearly nowhere — 33 yards on 23 plays, all six possessions ending in punts.

But the defense, which head coach and former defensive coordinator Manny Diaz said he was taking more of a role with this week, did its part to keep Miami in front. Virginia got inside the Miami 30 on six separate possessions, and came away with only three field goals on those drives. The others ended on downs, a fumble and the blocked field goal in the second quarter.

And Miami finally got moving in the fourth, getting to the Virginia 3 after trying a little of everything — even tight end Brevin Jordan’s first career carry. But they settled for a field goal, going up 10-6.

Virginia got within 10-9 on the ensuing possession despite a seven-play, zero-yard drive. Joe Reed’s 72-yard kickoff return was enough to get the Cavaliers in range, and Delaney connected on his third field goal of the night. Miami then went 75 yards for the clincher, Perry’s straight-ahead 3-yard rush for a score.

THE TAKEAWAY

Virginia: CB Bryce Hall, a preseason All-American and the national leader in pass breakups last season with 22, was taken off on a cart in the second quarter after a lower leg injury. He was hurt in punt coverage and the injury was quickly placed in an air cast, after trainers initially covered it with towels to shield others from seeing the severity. That will be a major blow to the Cavaliers.

Miami: Plagued by placekicker issues all year, and with walk-on backup Camden Price unavailable, the Hurricanes turned to redshirt sophomore Turner Davidson to handle the duties Friday night. Two-year starter Bubba Baxa missed a critical extra point that would have given Miami a late lead last week against Virginia Tech. Baxa missed three field goals of 30 yards or less so far this year, plus two PATs. Davidson last kicked in a game Nov. 11, 2016 — making a field goal for San Antonio’s Ronald Reagan High. Davidson was 2 for 2 on extra points Friday and made his lone field goal attempt.

POLL IMPLICATIONS

Virginia will likely fall from the AP Top 25 when the next poll is released Sunday, ending a run of five consecutive appearances. Virginia hasn’t had an appearance streak of six weeks or more since a 21-poll run spanning the 2004 and 2005 seasons.

ODD SERIES

Miami safety Amari Carter was ejected for targeting in the third quarter, meaning he’ll miss the first half of next week’s game against Georgia Tech. When Virginia’s offense lined up to resume play, Carter was still on the field — earning him another penalty for an illegal substitution.

UP NEXT

Virginia: Host Duke on Oct. 19, Virginia’s first home game since Sept. 21.

Miami: Host Georgia Tech on Oct. 19, ending a five-game homestand.