SAN FRANCISCO -- San Francisco Giants manager Bruce Bochy was out of options after emptying his bench of position players three innings earlier and with the potential winning run at third base in the 12th inning. Then, he turned to his best hitting pitcher.
It worked perfectly.
The Giants recorded their 10th walk-off win of the season, and won for just the fifth time in 22 games.
"It's tough this time of year to come and compete and play as hard as you ordinarily would but this is the time you have to look yourself in the mirror and go out there and do your job, earn your paycheck," Bumgarner said "As soon as we ran out of guys, I got my cleats and my jersey on."
After Hernandez tripled off Rowan Wick (0-1), Bochy called for Bumgarner.
Bumgarner took a called strike and then lined a sharp single past third baseman Myers to drive in the winning run. It was Bumgarner's fourth career pinch-hit and first since July 31, 2016. He has six hits and three RBI in 41 at-bats for a .146 average. He has a career batting average of .182.
"He smoked it, didn't he?" Bochy said.
Mark Melancon (1-3) retired six batters to earn win.
At 63-95, the Padres are assured of their worst record since 2008, when they finished 63-99.
San Diego stranded a runner at third in the 11th and at first and third in the 12th. The Padres also matched their season high of three errors, two by shortstop Javy Guerra.
"It's a tough one for us," San Diego manager Andy Green said. "We gave away some runs on the defensive side and it's tough. We've played relatively clean defense for a while and we didn't really do that today."
Pence, who reached on an error and scored in the first, homered off Robbie Erlin in the fourth and received a standing ovation from the announced crowd of 36,063.
The 35-year-old outfielder also singled and scored the go-ahead run on Gregor Blanco's double off Robert Stock (1-2) in the seventh. Blanco had been 5-for-32 with runners in scoring position.
Recognized as one of the driving forces behind the Giants' World Series titles in 2012 and 2014, Pence is scheduled to become a free agent in the offseason.
Giants: Panik didn't start but entered as a pinch-hitter in the seventh. Catcher Nick Hundley was hit in the back of the head on a follow-through swing by Austin Hedges in the 12th inning, but remained in the game.
San Diego RHP Luis Perdomo (1-6, 7.56) makes his first start since July 27 in the series finale Wednesday as part of manager Andy Green's plan to bullpen the game. Perdomo has made two relief appearances after being recalled from the minors earlier this month. RHP Casey Kelly (0-2, 2.04) makes his third start for the Giants and first against his former team. Kelly pitched for the Padres in 2012 and 2015.
More AP MLB:�https://apnews.com/tag/MLB�and�https://twitter.com/AP-Sports
Wilson Ramos, Mets reportedly agree to two-year contract
The Mets have their catcher, agreeing to a two-year deal with Wilson Ramos, per multiple reports.
Bradley promotes 2019 London Series
Red Sox outfielder Jackie Bradley Jr. weighs in on the 2019 London Series in which the Red Sox will take on the Yankees in London on June 29-30.
Top spenders Red Sox owe nearly $12 million in luxury tax
The World Series champion Boston Red Sox owe $11.95 million in luxury tax for having baseball's top payroll.
White Sox, James McCann reach 1-year deal
James McCann, who hit .220 with eight homers and 39 RBIs in 118 games for the Tigers last season, will stay in the AL Central after reaching a one-year deal with the White Sox.
Nationals bring back slugger Matt Adams on 1-year deal
The Nationals stayed busy this offseason by bringing back first baseman Matt Adams on a one-year deal, according to reports. Adams hit 18 home runs in 94 games for the Nats last season before going to St. Louis on a waiver claim in August.
White Sox have limits on Manny Machado, Bryce Harper
After trading for Yonder Alonso, who is Manny Machado's brother-in-law, the White Sox will make a pitch for Machado himself. But it seems they'll only go so far.