SAN FRANCISCO -- Bud Black's 500th win as manager of the San Diego Padres was going to be memorable no matter what.
However, it's hard to top the way it happened Monday night.
In a game that already had featured on of the best catches of the year, Black watched as a pitcher he called upon to pinch-hit came through with a game-winning bunt in the 13th inning as the Padres rallied to defeat the San Francisco Giants 5-3.
"Good win for us," Black gushed as he glanced at the game ball he'd received for becoming just the second manager in Padres history to reach the 500-win milestone.
Coincidentally, the historic win came at the expense of the only other man to achieve the feat for San Diego -- Giants skipper Bruce Bochy -- whose managerial blunder during the Padres' two-run 13th in essence handcuffed his own team's chances of rallying in the bottom of the inning.
The victory was the seventh in a row for the Padres, who used the win to leapfrog the Giants in the standings while also gaining ground on National League West front-runners Arizona and Colorado, both of whom lost earlier in the evening. San Diego (36-34) finished the night in third place, just one game out of first and now a half-game ahead of the fourth-place Giants (35-34).
In the longest game of the season for both teams, Alexi Amarista got the Padres' 13th going with a single to center off the Giants' seventh pitcher, Jose Mijares (0-1). Amarista advanced to third when Chris Denorfia's shot ate up Giants second baseman Tony Abreu for what was ruled a hit.
Then the managerial wheels starting spinning.
First, Andrew Cashner, the Padres' scheduled starting pitcher Tuesday night, was called upon to pinch-hit for winning pitcher Nick Vincent (1-0).
But rather than hit, Cashner pushed a hard bunt brilliantly toward shortstop Brandon Crawford, who was leaning toward covering second base. When third baseman Joaquin Arias tried to cut in front of Crawford to field the ball, it glanced off his glove for a hit as Amarista raced home.
"Pretty cool. I've never had a game-winning RBI," Cashner said. "Trying to get it past the pitcher was my goal."
The Padres went on to load the bases, prompting Bochy to summon Jake Dunning from the bullpen. The Giants' veteran manager also called for Buster Posey to enter the game at first base, mistakenly thinking that would allow his hottest hitter to lead off the bottom of the 13th.
However, that wasn't the case, and when Bochy realized his blunder and tried to remove Posey from the game, he was told by plate umpire Brian Gorman he could not do so.
"I messed up. I got distracted and was upset," said Bochy, who initially had gone out to argue a call along the right field line on a hit by Kyle Blanks. "Once I said it wrong, I was done. I knew that, but that's a first."
Amid the confusion, Dunning went on to walk Yasmani Grandal with two outs and the bases loaded, forcing in Denorfia with an insurance run.
Not having to face Posey in the bottom of the 13th, Huston Street pitched a scoreless inning to end the 4-hour, 35-minute marathon and record his 14th save.
"We have a lot of momentum," said Cashner, who hopes to continue it when he opposes Giants ace Matt Cain in Game 2 of the series Tuesday night. "It's a different guy stepping up every night."
The Padres out-hit the Giants 18-10 but stranded 17 runners on base in part because they struck out 16 times.
Other than the difference-makers in the 13th, neither team scored after the seventh inning in a game the Giants once led 3-1. All three of those runs came off Padres starter Edinson Volquez, who surrendered six hits in five innings.
The Giants appeared to have won the game in the bottom of the 12th when, with Brandon Belt on second base, Juan Perez blasted a shot over the head of Padres center fielder Will Venable. However, Venable, having already endured a nightmarish night at the plate, raced back and made a diving catch just before coming to a crash landing on the warning track.
"Game-saver," Black said.
Added Cashner, "One of the greatest catches I've ever seen. If Will doesn't make that catch, (the game-winning bunt) never happens."
Giants starter Barry Zito, looking to improve to 5-1 at home this season, left with a 3-1 lead in the top of the sixth. One of the baserunners inherited by Jean Machi scored on a wild pitch before the Padres assured Zito of a no-decision by scoring a game-tying third run off Machi in the seventh on an RBI single by Chase Headley.
Zito, who hadn't struck out more than five in any of his previous 13 starts, had eight strikeouts and three walks in his 5 2/3 innings. He was charged with two runs, and he gave up six hits.
NOTES: Bochy said of Venable's catch: "It's one of the best catches I've seen. It saved the game for them. It comes down to that." ... Denorfia went 3-for-6, improving his career average against the Giants to .358 (48-for-134), the highest among all San Francisco opponents. ... The last time the Padres came to San Francisco, the Giants swept them in a three-game series in April. ... Posey didn't bat in the game, meaning his 14-game hitting streak remains alive entering Tuesday's contest. ... The Giants are planning to have 2B Marco Scutaro back in the lineup Tuesday, a week after he suffered a damaged left pinkie finger when hit by a pitch. The All-Star candidate will don a custom orthotic splint he wore in batting practice and fielding drills Monday. ... Hot-hitting SS Everth Cabrera was able to make the trip north with the Padres after suffering a hamstring strain late in Sunday's win over Arizona. An examination after the game found no significant injury. He was given Monday off, and the team hopes to have him back on the field before the end of the three-game series. ... Giants second-round pick Ryder Jones met what he hopes will be his future teammates before the game at AT&T Park. The standout third baseman from Watauga (N.C.) High, who turned down a scholarship offer from Stanford in order to sign with San Francisco last week, is expected to play shortstop at his first minor league stop.