The game was slipping away, with Miami missing shot after shot in what looked like a brief stay in the Atlantic Coast Conference tournament.
Instead, the Hurricanes somehow reversed everything in a stunning comeback that will keep them in Greensboro a little longer.
Malcolm Grant scored 16 points as Miami rallied from 10 down in the final minute of regulation to force overtime and beat Virginia 69-62 in Thursday's first round.
If the ninth-seeded Hurricanes (19-13) are trying to top last year's surprise run to the tournament semifinals as a No. 12 seed, they're off to a good start. They trailed 53-43 with 42.5 seconds left before a frantic flurry erased the deficit and gave them another shot.
"I thought our guys showed a lot of character," Miami coach Frank Haith said. "I'm really proud of these guys because we've had some adversity all year in terms of tight ballgames. You've got to give these guys credit in not quitting and making plays down the stretch to give us a chance to win."
The Hurricanes had good reason to believe they could rally against the eighth-seeded Cavaliers (16-15). In the only regular-season meeting, Miami rallied from five down with 38.9 seconds left to force overtime and win 70-68 in Charlottesville on Feb. 5.
"Coach just told us in the huddle to never stop believing," Grant said. "We have a lot of time left. And our assistant coach, he told us that the same thing happened when we played them. We had a lot of confidence, and we just went out there and kept playing. You see what happens when you just keep playing."
Now the Hurricanes are preparing for another shot at sixth-ranked and top-seeded North Carolina - which beat the Hurricanes on a last-second 3-pointer in January - in Friday's quarterfinals.
The Cavaliers were left in stunned disbelief after the win disappeared in a haze of turnovers.
"I mean, when we were up 9 or 10 with 45 seconds left, I was thinking we were going to play North Carolina," senior Will Sherrill said.
But Durand Scott hit a 3-pointer to start Miami's rally, then Sammy Zeglinski missed a pair of free throws. Miami came back with another 3, this time from Grant, to cut the deficit to 53-49 with 23.1 seconds left.
The Cavaliers turned it over in the backcourt and Julian Gamble (11 points) dunked home a basket on the inbound play to cut it to 53-51. Then Scott stole Jontel Evans' inbound pass under the basket and scored on a layup while being fouled to tie it with 13.9 seconds left.
He missed the free throw, but Zeglinski couldn't control the rebound as it bounced off his foot and out of bounds with 11.6 seconds left.
Grant lost the ball when it slipped out of his hands on a shot attempt, giving it back to Virginia with 1.3 seconds left. But again, the Hurricanes stole the inbound when Gamble jumped in front of Will Sherrill's pass near midcourt before missing a desperate heave at the horn.
"I felt good," Virginia coach Tony Bennett said, "but then - boom - it changed quick."
Once in the overtime, the Hurricanes played with confident ease. Grant hit three free throws to put the Hurricanes ahead for good, then assisted on a 3 from Garrius Adams (10 points) and the first of two straight baskets from Reggie Johnson that gave Miami a 65-57 lead.
Virginia got no closer than five late, while Adrian Thomas let out a triumphant scream with 31.4 seconds left as Miami started to celebrate.
"We were deflated. We tried to rally it in the huddle," Bennett said. "We really labored and struggled mightily down the stretch. You could see a little bit of a dazed look in their eyes, and that was evident."
Miami led by six at halftime then missed 17 of 19 shots in the second half while scoring just 12 points through the first 19 minutes, but the Hurricanes made all five of their shots in overtime.
Mustapha Farrakhan had 14 points to lead Virginia, which used a 20-2 run to take a 50-39 lead with 2:12 left.
The teams combined to make just 17 of 36 free throws (47.2 percent), the worst percentage in ACC tournament history. The previous low mark was 48.8 percent by Maryland and Clemson in the 1954 quarterfinals.