LOS ANGELES (AP) — Michael Perez hit a tying single in the ninth inning and pinch-runner Michael Chavis scored the go-ahead run on first baseman Freddie Freeman’s error to give the Pittsburgh Pirates a wild 6-5 victory over the Los Angeles Dodgers.

The loss snapped the Dodgers’ four-game winning streak.

The Pirates have won three of four against the Dodgers this month.

Pittsburgh manager Derek Shelton earned his 100th career victory.