Updated

Andres Torres singled in the winning run with two outs in the bottom of the 10th inning, enabling the San Francisco Giants to salvage the finale of a three-game series with the Philadelphia Phillies by posting a 4-3 victory at AT&T Park.

Marco Scutaro went 3-for-5 with an RBI single in the win, while Hunter Pence had a solo home run to help the Giants prevent Philadelphia from notching its first three-game sweep in San Francisco since 1984.

Barry Zito did his part as well for the Giants, limiting the Phillies to a run and four hits over seven-plus innings on the mound and contributing an RBI single at the plate. He was in line for his fourth win of the season, but Philadelphia scored twice against closer Sergio Romo in the ninth to force extras.

Javier Lopez (1-0) earned the decision after hurling a scoreless top of the 10th.

Chase Utley and Delmon Young each drove in runs during the Phillies' ninth- inning rally, with Kevin Frandsen slugging a solo homer earlier in the game.

"We came back in the ninth and gave ourselves a shot to actually win it," Phillies shortstop Jimmy Rollins remarked. "The way we wanted to play it is what matters most. We can stand tall on that and hopefully take that to Arizona (for the next series) and throughout."

Philadelphia starter Jonathan Pettibone was touched for three runs over 5 2/3 innings, with Antonio Bastardo (1-1) saddled with the loss after giving up a run on two hits in the 10th.

Bastardo was greeted by Buster Posey's pinch-hit single to begin the bottom of the 10th, with the reigning NL MVP moving up a base on Joaquin Arias' sacrifice bunt and reaching third when Bastardo uncorked a pitch in the dirt, but was on the verge of escaping trouble after fanning Guillermo Quiroz for the second out.

Torres delivered, however, by lining the first pitch he saw from Bastardo over second baseman Utley's head and into shallow right center to put the Giants on top.

"I want to be aggressive," Torres said of the at-bat. "I was sitting on one of his sliders, but he threw me a fastball."

Philadelphia's offense was held squarely in check by Zito, but sprung to life when Romo entered to protect a 3-1 lead in the ninth.

Rollins began the comeback with a leadoff double into the right-field corner, then took third on a Frandsen flyout before Michael Young drew a walk to put two men aboard. Utley then laced a single up the middle that brought in Rollins and advanced Michael Young to third, with Delmon Young following with a sacrifice fly to right that evened the score at 3-3.

Pettibone matched Zito through the game's first four innings by surrendering just a single run to that point, but the Giants broke through against the rookie with a two-out surge in the fifth to move in front.

After Gregor Blanco singled off the right-field wall and stole second to move into scoring position, Scutaro hit a flare into center that dropped in front of the Phillies' John Mayberry to give San Francisco a 2-1 lead.

Zito extended the margin with a clutch two-out hit of his own in the sixth, with the veteran lefty's slap single plating Brandon Belt and ending Pettibone's afternoon. Belt had reached on a leadoff walk, one of two free passes issued by Pettibone during the inning.

"I got a fastball in and tried to pull my hands in," said Zito of his key hit. "I don't try to pull the ball too often, but I was able to have a quicker bat through the zone right there."

Pence opened the scoring by clubbing a hanging slider from Pettibone into the seats in left to begin the bottom of the second, but Philadelphia countered on Frandsen's leadoff homer in the fourth, only the second hit allowed by Zito on the day.

Game Notes

Frandsen's homer was only the second run Zito has allowed in five home starts this season, spanning a total of 33 innings ... Charlie Manuel participated in his 1,331st game as the Phillies' skipper, tying Gene Mauch (1960-68) for the most by a manager in club history ... Scutaro extended his hitting streak to eight games and is batting .500 (15-for-30) during the tear ... Giants reliever Santiago Casilla exited the game with an injured right knee after facing just two batters in the eighth ... The Phillies' last 13 home runs have all been solo shots following Frandsen's blast.