Miami Coach Jim Larranaga, who spent more than a decade at George Mason, has arguably the nation’s hottest team in Coral Gables with the second-ranked Hurricanes. (J Pat Carter/Associated Press)

Virginia came to Miami on Tuesday night hoping to erase the memories of a defensive performance in their previous game that was among the worst Coach Tony Bennett had witnessed during his four seasons leading the program.

The Cavaliers did just that for 39 minutes, only to wilt in heartbreaking fashion with the game on the line. Virginia’s defense broke down late and it allowed the No. 2-ranked Hurricanes to escape with a 54-50 victory in front of a raucous sellout crowd at BankUnited Center.

After clamping down on Miami following a shaky start, the Cavaliers (18-8, 8-5 ACC) allowed the country’s hottest team to score two uncontested baskets in the final minute. Hurricanes center Reggie Johnson provided the game-winning basket when point guard Shane Larkin found him sneaking behind Virginia forward Akil Mitchell for a wide-open lay-in with 5.7 seconds remaining.

Mitchell said Miami (22-3, 13-0) ran a double-screen play for Larkin, and he thought the Hurricanes planned to pass the ball to forward Kenny Kadji on the perimeter. Instead, Larkin hit Johnson rolling to the basket.

“For playing such a sound majority of the game defensively, it does sting to give him one at the rim, because you want them to at least earn it,” Bennett said.

The Post Sports Live crew debates the number of ACC schools likely to get an NCAA tournament bid. (Post Sports Live/The Washington Post)

It was all the more disheartening given the resiliency the Cavaliers showed down the stretch against a Miami team that has reeled off 14 straight wins. Virginia trailed much of the night, but tied the score at 47 on a three-pointer by junior Joe Harris (team-high 16 points) with 57 seconds to go.

Larkin responded by blowing past Virginia point guard Jontel Evans — Bennett said sophomore Paul Jesperson failed to provide adequate help during the play — on the ensuing possession, allowing Miami to regain the lead.

“I wish we could get those two possessions back,” Evans said of Miami’s final two field goals.

Harris then missed the second of two free throws, moments after missing out on the chance for a three-point-play, and Larkin nailed both of his on the other end to put the Hurricanes on top by three with 28 seconds to play.

But out of a timeout, Bennett said Virginia assistant Ron Sanchez drew up an inbounds play for forward Evan Nolte. With Miami paying so much attention to Harris, the freshman Nolte nailed a three-pointer to tie the score at 50 with 14.3 seconds remaining in regulation.

That, though, only set the stage for Johnson’s heroics, and once Jesperson responded by throwing the ensuing inbounds pass directly to Miami guard Durand Scott, Virginia’s fate was sealed. The Cavaliers had missed out on the sort of marquee victory they’ll need come Selection Sunday.

“Frustrating would be an understatement,” Harris said. “It was just unfortunate that maybe a mental miscue or two happened there at the end, especially when we played so hard defensively and made it so tough on them the whole game.”

Early on, the Hurricanes came out firing as the Cavaliers’ defense picked up where it left off when it gave up a season-high 93 points at North Carolina Saturday. Miami hit seven of its first eight shots, jumping out to a seven-point lead.

Virginia seemed incapable of keeping the Hurricanes’ speedy guards out of the lane and Miami’s big men had their way inside, to the chagrin of an irate Bennett. But Virginia weathered the Hurricanes’ initial storm, and as the game wore on, the pace slowed to Bennett’s liking. His defense, meanwhile, finally arrived and Miami scored just eight points over the final 13 minutes of the half.

It allowed the Cavaliers to enter halftime down just 24-22, despite shooting 33.3 percent from the field.

“We got back to the only way that would give us a chance in this setting,” Bennett said. “You got to be very sound to beat them and we almost were. But we were just a few possessions away.”