PHOENIX (AP) -- J.J. Putz knew he was in trouble as soon as he let go of the ball.
Putz surrendered a two-run homer to Pablo Sandoval with one out in the top of the ninth inning and the San Francisco Giants rallied to beat the Arizona Diamondbacks 2-1 on Tuesday night.
Putz came on after Trevor Cahill gave up a leadoff single to Angel Pagan, only the fourth hit the right-hander allowed. Putz struck out Scutaro and got ahead of Sandoval with a split-finger fastball before throwing another splitter that stayed over the middle of the plate.
"It seems like every time I leave one of those up, it's getting crushed right now," said Putz, who has four blown saves in nine chances. "It's very frustrating. The one to Sandoval just didn't come out of my hand.
"That's pretty much how the split is. If it doesn't come out of your hand right, that's pretty much going to happen."
Sandoval's home run, his 11th hit in 17 at-bats over his past four games, squandered a stellar outing by Cahill, who finished with one run allowed over eight-plus innings with one walk and five strikeouts.
"I figured he would leave me in until I got somebody on," Cahill said. "It's real frustrating when it is so close and you can't finish it out. You're going to kick yourself even more than if you only went three and gave up 10 runs. It's a bad feeling."
Sandy Rosario (1-0) recorded the last out of the eighth inning for his first career win, and Sergio Romo pitched the ninth for his 10th save.
Josh Wilson had given the Diamondbacks a 1-0 lead with a home run in the bottom of the eighth off Santiago Casilla, who had come on after Madison Bumgarner threw seven scoreless innings. It was Wilson's first homer since June 25, 2011, for Milwaukee at Florida.
The late-inning power display was in sharp contrast to the game's first 7 1/2 innings. Bumgarner allowed three hits, walked one and struck out two before giving way for a pinch-hitter when his spot in the lineup came up in the eighth.
Only two players had reached base during the game for either side, both in the fourth. Scutaro singled to lead off the inning for the Giants and went to third on a single and fielder's choice, while Martin Prado singled to start the bottom of the inning and advanced on a two-out single.
The pitchers' duel was nothing new for Cahill, who has pitched in only one game decided by more than two runs so far. In his last four starts, both teams have combined for an average of 4.0 runs per game, including a 1-0 victory over Los Angeles on April 14 in which Cahill earned a no-decision after trading zeroes with Josh Beckett for 7 1/3 innings.
Over his past two starts, Cahill has allowed two runs - one earned - on eight hits over 13 innings.
"I didn't want him to take the loss," Arizona manager Kirk Gibson said. "I had confidence in my closer and it didn't work out."
Bumgarner struck out two, threw 62 of 102 pitches for strikes and lowered his ERA to 1.55. He became the first Giants pitcher with at least six starts of two or fewer runs since Kevin Correia went seven such outings in 2007.
NOTES: Arizona SS Didi Gregorius, who was hit in the head by a pitch from Colorado's Josh Outman on Friday and subsequently placed on the 7-day concussion list Sunday, passed all concussion exams Tuesday and was cleared to resume baseball activity. The rookie had appeared in seven games, going 11 for 27 with a pair of home runs. ... Giants manager Bruce Bochy said Scutaro will be given the day off Wednesday ahead of San Francisco's scheduled off day Thursday. ... Arizona signed OF Juan Rivera to a minor league contract. Rivera had been with the New York Yankees in spring training on a minor league deal after hitting .244 with nine homers and 47 RBIs for the Los Angeles Dodgers last season. ... The Diamondbacks traded minor league IF Mark Teahan to Cincinnati for a player to be named later. ... Giants LHP Jeremy Affeldt, eligible to come off the 15-day disabled list Wednesday, is scheduled to throw either during an extended spring game or for Class A San Jose and be reinstated Friday. ... Arizona RHP Brandon McCarthy will seek his first win with the Diamondbacks when he faces RHP Tim Lincecum and the Giants in the series finale Wednesday. Lincecum is 7-8 with a 3.44 ERA in 21 career starts against Arizona, but has lost his last six against the Diamondbacks dating to Sept. 29, 2010.
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.