MIAMI (AP) — Luis Arraez had two hits and drove in three runs, including a go-ahead RBI groundout in the 10th inning, and the surging San Diego Padres beat the Miami Marlins 9-8 on Saturday. David Peralta singled twice and doubled for the Padres, who have won 16 of their last 18 games. Ha-Seong Kim drew a leadoff walk against reliever John McMillon (0-1) to start the winning rally.

Kyle Higashioka’s sacrifice bunt advanced Kim and automatic runner Tyler Wade before Luis Arraez hit a soft grounder to first baseman Jonah Bride that scored Wade. Robert Suarez (7-1) pitched a perfect ninth for the win, with 11 of his 15 pitches reaching 100 mph. Miami’s Derek Hill reached on a leadoff bunt single against reliever Tanner Scott in the bottom of the 10th, advancing automatic runner Vidal Bruján to third.

After pinch hitter Cristian Pache popped out, Xavier Edwards hit a grounder to third baseman Manny Machado, who threw Bruján out at home. Acquired from Miami at the trade deadline, Scott struck out Jake Burger for his 19th save. Jackson Merrill’s two-run homer in the eighth tied it at 7-all.

Peralta followed with a double and Kim’s sacrifice bunt advanced pinch runner Bryce Johnson to third. Arraez’s two-out infield single scored Johnson and to put the Padres ahead. Miami tied it in the bottom half on Burger’s solo homer, his 21st homer and 11th since the All-Star break.

The Marlins sent 12 to the plate and scored six runs in the fifth for a 7-3 lead. Jesús Sán.