SAN DIEGO (AP) An unlikely team and an unlikely player put the World Series champion San Francisco Giants closer to elimination Thursday night.
The San Diego Padres edged the Giants 5-4 on pinch-hitter Alexi Amarista's ninth-inning single.
''I was trying to get a hit and be the hero,'' Amarista said through a translator. ''Just try to get the run in, it didn't matter how.''
The loss dropped the Giants eight games behind the NL West-leading Dodgers with 10 remaining. San Francisco trails the Chicago Cubs by 10 games for the second wild card.
Derek Norris opened the inning with a double off Mike Broadway (0-2), his third extra-base hit of the game. Travis Jankowski ran for Norris and advanced to third on Melvin Upton Jr.'s sacrifice bunt.
Pinch-hitter Brett Wallace was intentionally walked before Amarista's hit to left-center.
''That was a beautiful execution by Alexi,'' Padres interim manager Pat Murphy said.
Craig Kimbrel (4-2) pitched the ninth to earn the win.
Matt Kemp's one-out double off San Francisco reliever Sergio Romo tied the score at 4 in the eighth.
''This goes to show you how hard it is to get a win,'' Giants manager Bruce Bochy said. ''Give them credit. They fought back and got a couple of big hits.''
Matt Duffy had three hits for San Francisco.
Giants ace Madison Bumgarner went seven innings and was charged with three runs, three hits and three walks while striking out nine.
''We lost a couple of tough ones here,'' Bumgarner said.
It was Bumgarner's second straight strong performance against the Padres. He was four outs shy of a perfect game in beating them 1-0 on Sept. 12.
This time, Bumgarner threw a season-high 120 pitches.
''He was fine,'' Bochy said. ''He had an extra day and he did a great job.''
Ian Kennedy went five innings for San Diego and was charged with four runs and 11 hits. He struck out five and balked home a run.
''We squandered those early opportunities and it came back to haunt us,'' Bochy said. ''We just missed out there putting up a big inning. They get a three-run homer and boom, we're down.''
Norris' three-run homer in the second gave the Padres a 3-1 lead. The shot to right field skidded off the top of the fence. It was his first home run since Aug. 14.
The Giants jumped to a 1-0 lead on Brandon Crawford's second-inning homer. It was his 20th of the season, one more than he had the last two years combined.
But for the second consecutive night, the Padres rallied for a dramatic win.
''I think there are some pieces here going forward,'' Murphy said. ''They came here with an intent and while it is too late for them this year, look at the last three games against a team with a lot to play for. There is a lot to look at in this group. They are not that far off.''
ZITO AND FRIENDS
Kevin Frandsen bought tickets to see Oakland's Barry Zito, his ex-Giants teammate, pitch on Saturday when the A's face the Giants. What Frandsen didn't expect was to be on the field. His contract was purchased from Triple-A Sacramento on Wednesday. ''He texted me and said we may face each other,'' Frandsen said. ''This is hilarious. At least I will have a better seat for what should be an insane O.Co Coliseum.''
Padres broadcaster Dick Enberg met with the media after announcing his retirement following the 2016 season on Wednesday night. Enberg, the recipient of the Baseball Hall of Fame Frick Award this summer, is hoping his last season is special. ''That's why we're baseball fans,'' he said. ''We always think it's going to be next year.''
Padres: 3B Yangervis Solarte (right hamstring cramp) was a late scratch from the lineup. He flied out as a pinch hitter. ... RHP Bud Norris left the game with a right groin strain.
Giants: OF Hunter Pence (oblique) and 1B Brandon Belt (concussion) remain out, and Bochy said he doesn't expect either to play again this season.
Giants: RHP Mike Leake (10-9, 3.81 ERA) looks for his second win in six decisions with San Francisco as the Giants open a three-game series at Oakland. Leake lasted three innings in his last start, taking the loss after allowing three runs and eight hits.
Padres: RHP Casey Kelly (0-0, 4.50) makes his first start since 2012 as he rebounds from two Tommy John surgeries. A 2009 first-round draft pick by the Red Sox, Kelly worked two innings of relief on Sept. 19 at Colorado, charged with a run and five hits.