COLUMBIA, S.C. — With one swing of the bat, Virginia baseball’s miracle run went from life support to Omaha-bound.

Freshman right fielder Kyle Teel was at the plate, looking to erase a one-run deficit for the Cavaliers with the bases loaded and two outs in the seventh inning. Dallas Baptist relief ace Peyton Sherlin had struck Teel out in the opener of this super regional series Saturday, and the left-hander was one strike away from stranding three Virginia base runners with another punch-out in Monday’s deciding Game 3.

But for a Virginia team that started 4-12 in conference play and faced elimination six times in the past 10 days, being on its last legs was nothing new. Teel turned on Sherlin’s 2-2 pitch, sending it out over the wall in straightaway center field off the base of the batter’s eye for a go-ahead grand slam.

Matt Wyatt secured the final six outs to conclude a stellar outing in relief, and Virginia clinched its first trip to the College World Series since 2015 with a 5-2 victory.

“[Sherlin] is a really good pitcher,” Teel said. “He has really great stuff. His go-to pitches against lefties were breaking balls. I was just waiting for one that was a good pitch to hit. That was my approach: hit the breaking ball.”

As it did in two of its elimination-game victories last week, Virginia fell behind early. Dallas Baptist slugger Jackson Glenn opened the scoring with a towering two-run home run off Cavaliers starter Nate Savino in the third inning that almost went out of Founders Park. It was Glenn’s 21st home run of the season and second of the series.

Dallas Baptist started another scoring threat with a sharp one-out single in the fourth, and that was the end of Savino’s outing. Virginia Coach Brian O’Connor went to Wyatt out of the bullpen to hold the Patriots at bay, and he slammed the door on one of the nation’s toughest offenses. Wyatt recorded the final 17 outs for Virginia, surrendering only two hits while striking out eight to keep the Cavaliers in the game.

“Going out there and pitching, I just wanted to keep putting up zeros,” Wyatt said. “I was confident eventually something would get rolling with the offense.”

Something did get rolling when Nic Kent cut the deficit in half with a solo home run in the fourth, but after that the Cavaliers struggled to find the big hit. Virginia was 0 for 5 with runners in scoring position through the first six innings, including back-to-back strikeouts with the tying run on third in the fifth.

With two outs in the seventh and Jake Gelof on second base representing the tying run, Gelof’s brother, Zack, had a chance to break the drought. Zack Gelof did not get the elusive hit, but he drew a walk that knocked Dallas Baptist reliever Ray Gaither out of the game and compelled Patriots Coach Dan Heefner to bring in Sherlin to put out the fire. Sherlin entered with six consecutive scoreless outings under his belt, including in Game 1 against the Cavaliers.

Max Cotier kept the line moving with a single into shallow center field that loaded the bases, bringing Teel to the plate with the inning — and potentially the season — hanging in the balance.

Teel entered the at-bat hitting .358 on the season with runners in scoring position and .397 with two outs. He skied Sherlin’s 2-2 breaking ball into deep center field, but for a moment it looked as though it would be a loud third out.

“When I hit the ball, I did not think it was out,” Teel said. “I thought I hit a deep flyout. I was very, very grateful for it to go over the fence.”

On another day, the ball might have died on the warning track. But for these Cavaliers, who have had their backs against the wall for almost two weeks in Columbia, it was the latest in a long list of memorable moments on a run to the College World Series.

Virginia became the third team since the NCAA baseball tournament expanded to 64 teams to advance to the College World Series after losing its opening game in the regional and super regional rounds, joining Rice in 1999 and Florida State in 2008 as teams to win six elimination games on the road to Omaha.

The Cavaliers will open their College World Series run with a matchup against No. 3 seed Tennessee at 2 p.m. Sunday.

Read more from The Post: