SAN DIEGO (AP) For four innings, San Diego Padres rookie Luis Perdomo kept the Los Angeles Dodgers at bay as the game stretched deep into extra innings.
All San Diego needed was to score a run for what would have been a third straight walk-off win.
It didn't happen, and the Dodgers finally caught up to Perdomo. Yasiel Puig hit a tiebreaking, two-run single with the bases loaded and one out in the 17th inning and the Dodgers beat the Padres 9-5 on Sunday to snap a four-game losing streak.
The game started in afternoon sunshine and ended at dusk, taking 5 hours, 47 minutes.
Perdomo (1-1) was the hard-luck loser after pitching five innings.
''He pitched really, really well,'' manager Andy Green said. ''He didn't deserve that fate. I would've been nice if we had scratched one across.
''I thought he was excellent. That's a really tough gig for a young guy to come in. I couldn't be more pleased with him today.''
The Dodgers started the four-run rally when Howie Kendrick hit a leadoff double that bounced over the wall in right-center field. Adrian Gonzalez was intentionally walked and reliever Ross Stripling advanced them with a groundout. Joc Pederson was intentionally walked to load the bases, and then Puig singled up the middle. Pederson scored on a wild pitch and Carl Crawford hit an RBI grounder.
''I was just attacking hitters,'' Perdomo said. ''In my first start I wasn't attacking guys but today I was. Between now and then I've focused on calming down and controlling my adrenaline a little more.''
Stripling (2-3), scheduled to start Tuesday night against Cincinnati, pitched three innings for the win.
The Padres won Friday night on a ninth-inning homer from Melvin Upton Jr. and on Saturday night with Yangervis Solarte's game-ending walk in the 11th.
''We were on the cusp of sweeping the Dodgers today,'' Green said. ''We had the opportunity. It stings to let that slip away.''
The Dodgers loaded the bases in the 14th and failed to score. They used Clayton Kershaw as a pinch-hitter in the 15th.
The Dodgers might have scored the go-ahead run in the ninth if not for a baserunning blunder by Puig, who hit a leadoff single against Fernando Rodney and took second on a wild pitch. A.J. Ellis bunted, but Puig didn't take third, even though it was open because Solarte fielded the bunt. Ellis raised his arms in frustration after seeing that Puig didn't advance. Crawford lifted a fly ball to shallow left that might have brought in Puig.
Plate umpire David Rackley left the game in the fifth after getting hit in the groin by a foul bunt attempt by Pederson. Rackley collapsed, was down for about 5 minutes and was tended to by a Padres trainer. He had to be helped to his feet before leaving the field under his own power. Rackley handed a ball to a kid on his way to the tunnel.
Alfonso Marquez went into the umpires' room to change into his gear and moved from second base to the plate. The game resumed after a 15-minute delay.
The Dodgers erased a 4-0 deficit, getting a tying homer from Justin Turner in the seventh and then a shot from Howie Kendrick leading off the eighth for a 5-4 lead.
The Padres tied it in the eighth on Upton Jr.'s RBI triple to right-center off Kenley Jansen, with the ball sailing just past the outstretched glove of Pederson in center. That brought in Wil Myers, aboard on a leadoff walk.
The Padres jumped on Kenta Maeda for four runs on four hits in the sixth inning, including Myer's three-run triple that got by diving right fielder Puig. Christian Bethancourt had an RBI single.
L.A. got three of those runs back in the sixth in chasing starter Colin Rea. Corey Seager and Adrian Gonzalez hit RBI singles and another run scored on a wild pitch.
Maeda allowed four runs and four hits in five innings, struck out five and walked one.
Rea allowed three runs and three hits in five-plus, struck out three and walked two.
Dodgers: LHP Clayton Kershaw (6-1, 1.57) is scheduled to start the opener of a three-game home series against Cincinnati, which will counter with LHP Brandon Finnegan (1-2, 4.44).
Padres: LHP Drew Pomeranz (4-4, 1.96) will pitch Monday night's opener in a three-game series at San Francisco against Johnny Cueto (6-1, 2.70). The Giants swept the Padres last week for the second time this season.