Brian Anderson hit a go-ahead RBI single off David Robertson in the ninth inning and the Miami Marlins rallied for a 6-5 victory over the host Philadelphia Phillies on Thursday.

Lewin Diaz and Joey Wendle each hit a solo home run for the Marlins, who snapped a season-worst nine-game losing streak.

Avisail Garcia had three hits and an RBI while Garrett Cooper hit two doubles with an RBI for the Marlins (56-80).

Marlins starter Sandy Alcantara gave up eight hits and five runs, three earned, in six innings. Alcantara struck out seven and walked none.

Dylan Floro (1-2) earned the win with two innings of scoreless relief.

Nick Maton hit a solo home run and Alec Bohm added a double, triple and two RBIs for the Phillies (75-62).

Rhys Hoskins had three hits and Bryson Stott contributed a double, two singles and an RBI for the Phillies.

Phillies starter Kyle Gibson tossed five innings and allowed nine hits and four runs to go along with two strikeouts and one walk.

Robertson (4-3) took the loss.

The Marlins went ahead 3-0 in the third inning when Diaz hit a solo homer to right field and Cooper added an RBI double. Garcia also contributed an RBI single.

Maton launched a solo homer with two outs in the bottom of the third to close the Phillies within 3-1.

In the fourth, J.T. Realmuto produced an RBI groundout and Stott blooped an RBI double to left to tie the game at 3.

Miami regained a 4-3 advantage when Wendle ripped a solo homer in the fifth.

Kyle Schwarber reached first with two outs in the fifth when JJ Bleday committed a fielding error in center. Hoskins singled and Bohm followed with a two-run triple past a lunging Bleday for a 5-4 lead.

Cooper opened the ninth with a double and his pinch-running replacement Bryan De La Cruz scored to tie the game when Wendle’s grounder eluded Hoskins just enough for a fielding error.

Jean Segura grounded into a double play in the bottom of the ninth to end the game.

–Field Level Media