Updated

Marco Scutaro's bases-loaded walk in the bottom of the ninth inning brought in the winning run as the San Francisco Giants rallied for a 3-2 victory over the Boston Red Sox in the middle test of a three-game set.

The Red Sox led 2-1 entering the eighth, but Buster Posey's sacrifice fly against Junichi Tazawa tied the contest.

Roger Kieschnick had a one-out single against Franklin Morales (2-1) in the ninth before Joaquin Arias lined out. Pinch-hitter Andres Torres walked and another pinch-hitter, Hector Sanchez, was hit by a pitch to load the bases.

Brayan Villarreal replaced Morales on the mound and walked Scutaro on four straight pitches to plate Kieschnick for the winning run.

"I'm holding back on Koji because if we push across a run, he's going to close the game out," Farrell said of his decision not to bring in the closer Koji Uehara in the ninth inning.

Kieschnick tallied three hits and a pair of runs scored, while Brandon Belt smacked a triple and double among his three hits for the Giants, who have won four of their last six games.

"You take it anyway you can get it and this was a good one," Giants manager Bruce Bochy said.

Sergio Romo (4-6) tossed a scoreless top of the ninth to pick up the win.

Highly-touted Red Sox prospect Xander Bogaerts made his MLB debut at shortstop, but was hitless in three at-bats before being replaced as part of a double switch in the sixth. The 20-year-old was the youngest Red Sox positional player to make his debut since Dwight Evans in 1972 and youngest shortstop since Luis Alvarado in 1969.

Shane Victorino belted a solo shot for Boston, which has dropped five of its last seven tilts to fall into a first-place tie with the Tampa Bay Rays atop the AL East.

Boston plated a run in each of the first two innings to jump out to a 2-0 lead. Matt Carp had a sacrifice fly in the opening frame and Victorino drilled a leadoff shot down the left-field line that ricocheted off the ambulance to make it 2-0.

San Francisco halted a 16-inning scoreless drought in the fifth on Arias' RBI triple to pull within 2-1.

Game Notes

Jake Peavy surrendered a run on five hits and a walk over 5 2/3 innings in the start for Boston ... Giants third baseman Pablo Sandoval was scratched because of back soreness ... Red Sox pitcher Ryan Dempster was suspended five games and fined an undisclosed amount for intentionally throwing at Yankees third baseman Alex Rodriguez during Sunday's game at Fenway Park.