CHARLOTTESVILLE, Va. (CBS19 SPORTS) -- No. 11 Virginia rallied in extra innings to clinch the series against North Carolina on a walk-off grand slam from Devin Ortiz to win 11-7.

The series win over the Tar Heels is the program's first since 2016 and UVA's first ACC series win since Georgia Tech in early April.

The two ACC Coastal rivals went back and forth throughout the game with six lead changes and three ties. Jake Gelof broke out of his recent slump to tie the game twice with a solo home run in the fourth and an RBI-single in the sixth. The home run was the 15th of the season for Gelof, which ties the sophomore for fifth-most in a season with Mark Reynolds.

With the game tied at 4-4 in the bottom of the ninth, Virginia loaded the bases, but failed to capitalize sending the game into extra innings.

The Tar Heels jumped out to a three-run lead in the tenth with two runs coming on a double from Mac Horvath putting the Cavaliers in a hole. But Virginia would rally with pinch-hitter Casey Saucke and Kyle Teel notching RBIs to move within one run, followed by Alex Tappen tying the game at 7-7 with an RBI-single.

UNC would then intentionally walk Gelof after his 2-4 day with a home run to load the bases. Ortiz would drive on the first pitch he saw for the walk-off grand slam, the third grand slam of his career and fifth by a Cavalier this season. The walk-off win was the second of the season for Virginia, the first coming against Boston College.

The win gives Brian O'Connor 780 career wins, tying him for the eighth most in ACC history. Virginia will look for the series sweep on Sunday at 2 p.m.