– Mamadi Diakite swatted the ball and with it, what looked like Virginia’s chance at a long overdue trip to the Final Four.

Diakite sent the ball hurtling toward the opposite end of the court off a missed free throw. The Cavaliers trailed by two points. The clock was ticking away fast: 5, 4, 3 …

More heartbreak loomed. More talk about tournament failures. More criticism of a coach who has built a model program, except for one giant hole in his résumé.

Virginia needed a miracle. Or, the “play of the century,” as one player described what happened next.

Diakite and quick-thinking teammate Kihei Clark combined for a sequence that will go down among the most memorable in NCAA tournament history.

The top-seed Cavaliers used a buzzer-beater to keep their season alive with a heart-pounding 80-75 overtime victory over Purdue in the South Region final at KFC Yum! Center on Saturday night.

“I don’t know how to talk about it,” Diakite said. “It was unbelievable.”

No worries. The last play of regulation left lots of people speechless.

Ahead 70-67, Purdue opted to foul Ty Jerome with 5.9 seconds left and send him to the foul line rather than risk giving up a three-pointer.

Jerome made the first free throw. His second missed and got tapped into the backcourt by Diakite. Clark chased it down all the way at the opposite three-point line with 3.3 seconds left.

“I was trying to get it as fast as possible,” Clark said. “I could have maybe taken a couple of dribbles and heaved it. I probably wouldn’t have made it.”

Jerome clapped his hands and screamed for the ball as Clark grabbed it and turned back up court. Clark took two dribbles and fired a bullet pass to Diakite near the basket.

Diakite caught the ball with less than a second left, released it a flash and the ball went in to send the game to overtime.

A buzzer-beater for the ages.

“Hats off to Mamadi,” Clark said. “I was just trying to do my job and retrieve the ball.”

Virginia (33-3) outscored Purdue 10-5 in overtime and survived one of the most sensational individual performances in tournament history by Carsen Edwards to earn the third Final Four appearance in program history, and first since 1984. Coach Tony Bennett’s Cavaliers exorcised some tournament demons — they have been a No. 1 seed four times in six years, but this is their first Final Four trip in that stretch. And it came one year after they became the first No. 1 seed ever to lose to a No. 16.

The ghosts of Maryland-Baltimore County won’t haunt them anymore.

“To finally quiet the critics feels great,” Jerome said.

They had to overcome a remarkable shooting display by Edwards, who scored 42 points — 24 in the second half — with 10 threes for the third-seeded Boilermakers (26-10), whose own Final Four drought extends to 1980.

Edwards made six three-pointers in the second half, many of them from NBA range.

Virginia defended the three-point line better than all but one Division I team this season, holding opponents to 28.1 percent shooting from behind the arc.

But the Cavaliers hadn’t faced Edwards, who also scored 42 points in the second round against Villanova. Saturday, he banked in a deep three-pointer with 70 seconds left in regulation while being smothered by the defense to give Purdue a 69-67 lead.

“That was the best performance I’ve ever seen,” Jerome said. “He just hit everything. Going to the basket, step-back threes. Unbelievable. Unbelievable. I told him after the game that he’s a hell of a player.”

The Boilermakers had one last gasp in OT. Trailing 78-75 with less than five seconds left, they expected Virginia to foul. Edwards thought he was going to get fouled — which he didn’t want — and fired an errant pass to Ryan Cline for a turnover.

Virginia’s Kyle Guy nearly matched Edwards big shot for big shot in the second half, to break out of his slump. Guy, a third-team All-America selection, was only 8-for-38 in the tournament before Saturday, including 3-for-26 on three-pointers.

Against Purdue, he scored 19 points in the second half, going 5-for-8 from three-point range.

“I’m going to keep shooting,” Guy said. “I don’t really feel like I’m ever out of rhythm.”