SAN DIEGO (AP) — Austin Nola hit a sacrifice fly with one out in the 10th inning for the San Diego Padres, who won 3-2 to snap a 10-game losing streak to the rival Los Angeles Dodgers.

Nola’s sac fly scored rookie CJ Abrams, who started as the automatic runner at second base and advanced on Trent Grisham’s sacrifice bunt. The Padres had been outscored 57-23 during the losing streak to the Dodgers, which dated to Aug. 24.

Losing three straight series to Los Angeles late last season helped contribute to the Padres’ stunning collapse, which left them with a losing record for the 10th time in as many full seasons since 2011.