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
Dave Roberts compliments Walker Buehler's command and defends his decision to not pinch-hit for him in the 5th inning with runners on base.
Corey Knebel speaks with Pedro Gomez on what went well for him in his outing and how he will be ready to go for Game 4.
Ryan Braun discusses how the Brewers have to battle to get all 27 outs against the Dodgers and how anxious he was at the end.
Jeremy Jeffress strikes out Brian Dozier, the tying home at home plate, to solidify the Brewers' shutout over the Dodgers in Game 3.
Jhoulys Chacin combined with four relievers on a five-hitter, Orlando Arcia hit a two-run homer and the Milwaukee Brewers beat the Los Angeles Dodgers 4-0 on Monday to take a 2-1 lead in the NL Championship Series.
Ryan Bruan gives the Brewers an early 1-0 lead on an RBI double down the left-field line.