They nearly had to play all night to get it done, but the Carolina Mudcats ended a painful losing streak Tuesday night.

With two out in the ninth, Shaun Cumberland (pictured) scored the go-ahead on a Brian Schlitter wild pitch that barely got away from catcher Wellington Castillo, and the visiting Mudcats held on for a 9-8 win over the Tennessee Smokies.

The Mudcats, who broke a five-game losing streak while ending Tennessee’s eight-game winning streak, took a 5-0 lead in the first inning before the Smokies began clawing back.

The game started 72 minutes late because of rain, and also continued after a 20-minute power delay in the third.

Carolina batted around twice, accomplishing the feat in both the first inning and the three-run fourth.

Juan Francisco hit his 20th homer of the season for Carolina, while Major League rehab addition Geovany Soto homered for Tennessee.

Sean Watson (W, 4-4) worked 1 2/3 innings of hitless relief to get the victory, while Francisco and Logan Parker had three hits apiece for Carolina.

Jeremy Horst (0-1, 7.94) will start the series finale for the Mudcats tonight at 7:15.