PHOENIX -- It started out as a San Francisco rout.
Then it looked like the biggest comeback victory in Arizona history.
But Mark Sweeney hit a tying two-run homer in the eighth and Steve Finley hit a sacrifice fly in the ninth to lift the Giants over the Diamondbacks 10-9 Monday night.
"We're a team that's going to battle you for nine innings," said Finley, a former Diamondback.
Barry Bonds was 1-for-3 with two walks, extending his homerless streak to 12 games -- the longest he has gone into a season when healthy without a homer since 1998, when he didn't hit one out until San Francisco's 13th game. He is stalled at 708 career homers -- seven shy of passing Babe Ruth's 714 and 48 from breaking Hank Aaron's mark of 755.
A 23-year-old Arizona man also was charged with disorderly conduct after allegedly throwing an object at Bonds in the fourth inning. The object, which resembled a toothpaste tube, landed a few feet in front of Bonds in left field and was removed by a security guard.
Bonds declined to speak to reporters after the game.
The Diamondbacks overcame a seven-run deficit to go up 9-7 on Luis Gonzalez' three-run homer in the sixth. It would have been the biggest comeback in team history but the Giants had a rally of their own.
The Giants led 7-0 after three innings.
"After the worst three innings of baseball I've ever seen, I think, at the big league level, I mean that was just awful," Arizona manager Bob Melvin said. "But to our credit we didn't die. We came back, we had a lead, had our closer in the game. Can't ask for much more than that."
Arizona scored four times in the fifth and sixth innings to go in front 9-7.
Andy Green led off the fifth with a pinch-hit homer. Craig Counsell walked and Eric Byrnes followed with his first homer with the Diamondbacks, cutting the lead to 7-4. Orlando Hudson had a run-scoring double for his second RBI of the game to get Arizona within two.
Chad Tracy singled in Green and scored on Gonzalez' three-run drive in the sixth to make it 9-7.
But the Giants pushed across three runs in the final two innings against two Arizona relievers. Luis Vizcaino walked Omar Vizquel with two outs in the eighth, then gave way to closer Jose Valverde (0-1). Sweeney responded with a two-run homer to tie it.
With a 2-0 count and a runner at first, Sweeney said he knew Valverde would have to come in with a strike because he didn't want to put two men on base for Bonds, who was on deck.
"I wasn't looking for anything other than a fastball because he throws pretty hard," Sweeney said. "I just wanted to drive it somewhere."
Ray Durham drew a walk off Valverde to lead off the ninth and scored two batters later on a sacrifice fly by Finley.
Steve Kline (1-0) pitched a scoreless eighth for the win and Tim Worrell worked a perfect ninth for his sixth save in six tries.
The defeat was Arizona's fifth in seven home games and left the Diamondbacks in last place in the NL West.
The biggest comeback for a victory in Arizona's nine-year history came in a 7-6 win over the Giants on Sept. 15, 1998. The Diamondbacks trailed 6-0 in the fourth inning. ... Arizona right fielder Shawn Green committed an error in the second inning, his first since Aug. 27, 2004. He had gone 200 consecutive errorless games in right field.