Ivan Melendez and Zach Zubia finally broke out offensively, and just in time to keep Texas alive in the College World Series.

Melendez doubled and scored the Longhorns' first run, and hit the tiebreaking single in the eighth inning to help Texas eliminate Virginia with a 6-2 victory in a weather-delayed game that ended early Friday.

"As you guys saw the last few weeks, I was slumping it," said Melendez, who entered the game 3 for his last 19. "I hit one to the warning track against Mississippi State and another against Tennessee and I've been drawing a few walks. I was hitting the ball hard, so that was a start."

Zubia was 3 for his last 29 when he stepped to the plate in the ninth, and he broke open a one-run game with a bases-clearing double into the left-center gap. He had struck out twice and grounded out in his first three at-bats.

"Trusting yourself and your work — I think I showed that in my last at-bat," Zubia said. "The first three were not the results any of us wanted. I was still grinding away and keeping my head down and taking each at-bat as new."

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

The No. 2 national seed Longhorns (49-16) won their second elimination game to reach the Bracket 2 final. They'll play Mississippi State and need to win Friday night and again Saturday to advance to the best-of-three finals next week.

Mike Antico singled and stole second before Melendez ripped a grounder up the middle to break a 2-2 tie in the top of the eighth, and the Longhorns got an inning-ending double play in the bottom half to turn back a threat by Virginia.

Zubia gave Texas a cushion with his two-out double. It looked as though Virginia might keep it a 3-2 game when shortstop Nic Kent saved a run by picking up a deflected ball and making an off-balance throw to get Douglas Hodo III at the plate on a close play upheld on video review.

"Huge blow by Zach right there after a great play by their shortstop," Texas coach David Pierce said. "This is what they’ve been doing. They like competing. They keep going. That’s the beauty about this team."

The loss ended an impressive postseason run for the Cavaliers (36-27), who made the NCAA Tournament as a No. 3 regional seed and were playing their seventh elimination game.

"This is as special a team in this uniform at this university. ... What they persevered through and the resiliency in the last two weeks was remarkable," Cavs coach Brian O'Connor said. "All the teams we have at Virginia are special in their own way, but this one is at the top."

Virginia had tied it in the fifth on Chris Newell's second homer in two games and fifth of the season. It was the 400th home run of the national tournament, the most since it expanded to 64 teams in 1999.

The Cavs might have been able to take the lead in the sixth had it not been for Texas left-handed starter Pete Hansen knocking down Kent’s line shot up the middle with one out. Kyle Teel was running from second on the play and was thrown out at third when the ball deflected off Hansen’s glove to shortstop Trey Faltine.

Hansen left after that play, having gone 5 2/3 innings in his shortest start since March 30. The redshirt freshman was mostly effective, allowing two runs on five hits. He walked two and struck out six.

Cole Quintanilla (5-0) pitched 1 2/3 innings and got the win, and Aaron Nixon went 1 2/3 innings for his ninth save. Matt Wyatt (4-2) took the loss after relieving Mike Vasil.

Vasil pitched seven innings to match his career high. He allowed two runs — one earned — and four hits with a walk. He struck out eight.

It was the third straight strong start for the Cavs at the CWS. Andrew Abbott pitched six innings in a 6-0 win over Tennessee on Sunday, and Griff McGarry took a no-hitter into the eighth inning in what turned out to be a 6-5 loss to Mississippi State on Tuesday.

The game started 3 hours, 39 minutes late because of rain and lightning. The 9:45 p.m. CDT first pitch was the latest at the CWS since an LSU-Alabama game on June 7, 1997, started at 11:40 p.m.

"We’re not going away," Pierce said. "This team is resilient. They can be ugly at times and play unbelievable defense and pitch and are opportunistic offensively."