SAN FRANCISCO -- Nick Hundley drove in Kelby Tomlinson with a single to the base of the fence in left field with two outs in the 12th inning Saturday, giving the San Francisco Giants a 5-4 victory over the San Diego Padres.
Eduardo Nunez drove in two runs with three hits and the San Francisco bullpen pitched six innings of one-hit ball, helping the Giants beat the Padres for just the second time in their last nine meetings at AT&T Park.
Wil Myers homered for the second straight day for the Padres, who posted a 12-9, 11-inning win over the Giants on Friday.
Brandon Belt opened the 12th with a single off the sixth Padres pitcher, right-hander Kevin Quackenbush (0-2).
After a fielder's choice, Tomlinson reached second base on a wild pitch and scored one out later on Hundley's blast over the head of Padres left fielder Jose Pirela.
Left-hander Josh Osich (3-1), the Giants' fifth pitcher, got the win after striking out three in 1 2/3 innings of shutout relief.
Right-handers Albert Suarez, Sam Dyson and Hunter Strickland bridged the gap from Giants starter Matt Moore to Osich.
Hundley finished with two hits for the Giants, who had lost 16 of their previous 21 games against the Padres since the 2016 All-Star break.
Myers' homer was his 19th of the season for the Padres, who were outhit 12-8.
The Padres used a four-run fourth inning to take a 4-1 lead against Moore.
Myers' solo shot ignited the inning, and Padres starter Luis Perdomo capped it with his third triple of the season, a two-run liner to right-center field.
The Giants came right back with three unearned runs against Perdomo in the bottom of the inning to get even. A one-out error by shortstop Allen Cordoba opened the floodgates.
Nunez's third hit, a two-out, two-run single, produced the 4-4 tie.
Like his counterpart in the top of the inning, Moore aided his own cause with a single during the Giants' rally. He scored the tying run on Nunez's hit.
Neither starter got a decision, each going six innings.
Perdomo allowed four runs (just one earned) and eight hits in his six innings. He walked two and struck out four.
Facing the Padres for the first time in his career, Moore gave up four runs and seven hits in his six innings. He struck out seven and did not walk a batter.
NOTES: The Giants formally announced the signing of 3B Pablo Sandoval to a minor-league contract before the game. He was scheduled to play at Class A San Jose on Saturday and Sunday before moving to Triple-A Sacramento on Tuesday. ... Asked before the game why the Giants would show interest in a guy who hit just .237 since leaving the organization after the 2014 season, manager Bruce Bochy noted, "You look at it as a free look at a player who has done good things." ... Padres RHP Luis Perdomo's triple was his third of the season, the most ever in a season by a San Diego pitcher. The last major league pitcher with three triples in the same season was LHP Dontrelle Willis in 2007. ... Both teams made roster moves before the game. The Padres placed SS Erick Aybar (bruised left foot) on the 10-day disabled list and reinstated LHP Buddy Baumann (sore left shoulder) from the 60-day DL. The Giants recalled INF/OF Orlando Calixte and RHP Albert Suarez from Triple-A Sacramento, making room on the active roster by demoting LHP Steven Okert and 3B Jae-Gyun Hwang.