SAN FRANCISCO -- When it comes to game-ending heroics, Marco Scutaro isn't picky.
A walk-off walk rather than a walk-off hit? It doesn't matter.
Scutaro drew a bases-loaded, four-pitch walk from Brayan Villarreal with two outs in the ninth inning Tuesday, completing the San Francisco Giants' rally for a 3-2 win over the Boston Red Sox.
It was a losing day all the way around for the Red Sox, who learned before the game that pitcher Ryan Dempster was suspended by Major League Baseball for five games for hitting the New York Yankees' Alex Rodriguez with a pitch Sunday night. Dempster chose not to appeal the suspension, which runs through Sunday.
Red Sox phenom Xander Bogaerts made his major league debut as the starting shortstop and went hitless in three at-bats. The 20-year-old was given a golden opportunity to produce a memorable first impression, but he grounded out to second base with the bases loaded to end the first inning, then grounded to shortstop with runners on second and third to end the third.
Down 2-0 at one point, the Giants scored single runs in the fifth and eighth innings to forge a 2-2 tie, then used Scutaro's walk-off walk to even the series at a game apiece.
"Bam Bam (Meulens, the Giants' hitting coach) told me the guy has been wild lately," Scutaro said of Villarreal, who was promoted from Triple-A Pawtucket on Monday. "That was very important when he told me that. I went up looking for my pitch, not be too aggressive."
Roger Kieschnick's third hit of the game, a one-out single, got the Giants' game-winning inning rolling. Scutaro came to the plate after Boston left-hander Franklin Morales (2-1) issued a two-out walk to pinch hitter Andres Torres, then hit pinch hitter Hector Sanchez to load the bases.
Villarreal, who walked eight in 4 1/3 innings for Detroit before being traded to Boston in the three-team deal July 30 that also brought Tuesday's starter, Jake Peavy, to the Red Sox, entered to face Scutaro. He failed to throw a strike with any of his four pitches, dropping the Red Sox into a first-place tie with the Tampa Bay Rays in the American League East.
The game-winning celebration was a bit muted near first base, but Scutaro enjoyed it nonetheless.
"We were dying for a win," he said. "Doesn't matter how you do it."
Red Sox manager John Farrell explained the thinking behind putting Villarreal in such a tight predicament in his first appearance for the club.
"(Morales) lost the strike zone, and you know how patient Scutaro can be," he said. "I decided to make a move."
Sergio Romo (4-6), the third Giants pitcher, got the win after pitching a 1-2-3 top of the ninth.
The ninth-inning excitement was set up when the Giants tied the game in the last of the eighth on Buster Posey's sacrifice fly off Red Sox reliever Junichi Tazawa. The long flyball, caught in foul territory by Boston right fielder Shane Victorino, scored Scutaro, who had singled.
Farrell admitted he sympathized with Victorino, who had to make a split-second decision whether to let Posey's ball land foul. That would have kept the at-bat alive, with two strikes on Posey, and retained Boston's lead. There was one out and runners on first and third at the time.
"Shane is straddling the line and the wind is blowing right to left," Farrell said. "If the ball blows back in (to fair territory) ... you're damned if you do and damned if you don't."
Giants manager Bruce Bochy agreed with his counterpart.
"That's a tough call there," he said. "You have a good batter up there. It's not like you're going to get an easy out (if you let the ball drop foul).
"Shane made a good throw. He made it a close play at the plate."
Victorino earlier hit his eighth homer of the season, a solo shot that staked Red Sox starter Jake Peavy to a 2-0 lead in the third inning.
Neither starting pitcher factored in the decision.
Facing a San Francisco lineup that was without Pablo Sandoval, who was scratched shortly before game time because of a sore back, Peavy gave up extra-base hits in the fourth, fifth and sixth innings, yet still managed to hold the Giants to one run in 5 2/3 innings. He gave up five hits, walked one and struck out four.
Brandon Belt also had three hits for the Giants, including a double and a triple. He and Kieschnick combined for six or San Francisco's eight hits.
Joaquin Arias also tripled for the Giants, who went 0-for-10 with runners in scoring position. They are hitless in 15 at-bats with runners in scoring position in the series.
Giants starter Ryan Vogelsong settled down after allowing two runs on five hits in the first three innings. In easily his best outing since breaking bones in and below his left pinkie finger on May 20, the veteran completed seven innings, striking out five and walking one. He gave up two runs on six hits.
Will Middlebrooks had two of Boston's seven hits.
NOTES: The Red Sox have not announced when Dempster will rejoin the rotation. ... Rehabbing RHP Clay Buchholz threw a 46-pitch simulated game at AT&T Park on Tuesday and was given the green light to advance to a full bullpen session Friday in Los Angeles. ... The Giants scratched RHP Chad Gaudin (carpal tunnel) from his scheduled start in the series finale Wednesday, replacing him with LHP Barry Zito. Gaudin was placed on the disabled list. ... The Giants created a second roster opening by designating LF Jeff Francoeur for assignment. LHP Mike Kickham and RHP Jean Machi were promoted from Triple-A Fresno to join the team. ... The Giants announced before the game that CF Angel Pagan (hamstring) would move his rehab assignment to Fresno on Friday.