CHARLOTTESVILLE — Five minutes into extra time Friday, Joe Bell stepped to the penalty spot with an opportunity to end a nervy night and send the Virginia men’s soccer team to the College Cup for the third time in 10 years.

A miserly bunch throughout a one-loss season, the top-seeded Cavaliers had allowed not one but two leads against SMU in the NCAA tournament to escape their grasp. For a change, defense was not going to carry the Cavaliers; they would need another goal.

The New Zealander failed to convert from 12 yards, but the rebound fortuitously fell back at his feet for an easy finish and the golden goal that propelled Virginia to a 3-2 victory in a nutty quarterfinal at Klöckner Stadium.

The Cavaliers (20-1-1) will travel to Cary, N.C. — the site of their ACC championship celebration three weeks ago — for a semifinal next Friday against No. 4 Wake Forest (15-4-2) or UC Santa Barbara (15-4-4).

Those teams will meet Saturday, as will third-seeded Georgetown (17-1-3) and No. 6 Washington (17-3-0) at noon in the District.

In Friday’s other quarterfinal, No. 7 Stanford (14-2-5) edged second-seeded Clemson (18-2-2) on penalty kicks, 5-4, after a 1-1 draw.

“The first thing we said after holding that [ACC] trophy was the road back to Cary,” Cavaliers Coach George Gelnovatch said. “One by one, we took care of business.”

This one was not easy. The Cavaliers went ahead in the 18th minute, but the eighth-seeded Mustangs (18-2-1) tied it in the 71st. The Cavaliers restored the lead in the 78th on Bell’s first penalty kick, but the second-highest-scoring team in the country answered in the 84th.

Early in sudden-death overtime, however, Daryl Dike, a 6-foot-2, 220-pound striker from Oklahoma, drew a penalty for the second time (and seventh this year).

It was a chaotic scene: The Mustangs howled in protest while their goalkeeper, Grant Makela, limped to the sideline with an apparent hamstring injury. He was replaced by Patrick Michael Hillyard, making his season debut.

Because Bell had already attempted one penalty in the match, perhaps offering clues to what he would do this time, Gelnovatch thought maybe someone else should take it.

“I was going to maybe suggest another person,” he said. “I am just happy it worked out.”

Bell shot toward the left side, the same as his previous try. Hillyard stopped it, but the rebound returned to the shooter for the simple goal from seven yards.

“Open goal — if I missed that, I would have been in big trouble with Coach George,” said Bell, who last month made his New Zealand national team debut. “It was a bit unlucky for [Hillyard] that it came back to me. Sometimes you need a little luck in these big games.”

Dike said, “Once I saw the ball rolling back to him, I already started celebrating because I know he is going to put it away. Even to step up to take a PK like that in the first place, I know it takes a lot of this [pointing to his heart] and a lot of that [pointing to his head].”

Mustangs Coach Kevin Hudson said of referee Mark Kadlecik’s call: “I know Daryl well [from recruiting him], and he’s not a cheat. I don’t think he’s going down for no reason. He probably makes a meal of it, but there’s still probably contact there.”

One or two goals figured to be enough for the Cavaliers, who entered the night with the fewest goals allowed in the country (seven) and the most shutouts (15). Axel Gunnarsson scored early, and after Gabriel Costa converted a penalty kick, Bell restored the lead when Dike was taken down.

But Henrik Bredeli scored the equalizer on an eight-yard header to force extra time. None of the previous 10 nonconference opponents had scored even one against Virginia.

With the dramatic victory, the Cavaliers will return to Cary in hopes of hoisting another trophy.

“Immediately after the [ACC title] game, we all just said we’re coming back here,” Dike said. “We’ve been saying it everywhere — “Road back to Cary” — and now we’re going back to Cary. Hopefully we have two more games there, not just one.”

Read more from Post Sports: