SAN FRANCISCO -- Matt Cain stymied the mighty Mets and singled in a run to help his cause, and the San Francisco Giants ended an eight-game losing streak to New York with a 2-0 victory Sunday night.
Bengie Molina also had an RBI single as San Francisco snapped a four-game skid and avoided a four-game home sweep in a game that featured a rare three balks by Mets starter Mike Pelfrey.
New York's potent offense couldn't get to Cain after producing 24 runs, 42 hits and 13 stolen bases in the first three games of the series. The Mets, in the midst of a 10-game road trip, lost for only the fourth time in 16 May games.
Pelfrey (4-1) kicked the mound in frustration following his third balk, in the sixth, that drew pitching coach Dan Warthen out for a visit. The last pitcher to have three balks in a game was Al Leiter for Toronto against Minnesota on April 23, 1994. It was only the second time in Mets franchise history that a pitcher had three balks. Don Rowe did it on April 27, 1963, at Philadelphia.
Bob Shaw holds the NL record with five balks for the Milwaukee Braves against the Cubs on May 4, 1963 -- and he had three in one inning.
Carlos Beltran's double in the eighth against Jeremy Affeldt put runners on second and third with no outs and gave him an 11-game hitting streak, but pinch-hitter Angel Pagan later grounded into an inning-ending double play.
Cain (4-1) pitched six shutout innings, while Bob Howry, Affeldt and Brian Wilson finished the five-hit shutout. Wilson earned his ninth save in 11 opportunities after losing the first two games of the series to New York.
Cain had lost last three outings to the Mets dating to a win during his rookie season of 2006. The right-hander also pitched six shutout innings in his last win, May 7 at Colorado.
Pelfrey walked Cain to start the third for the Mets' first free pass in three games, then allowed a single to the pitcher in the fifth that put the Giants ahead 2-0. New York had come from behind to win both Thursday and Friday nights, then broke open a tie game Saturday to win 9-6.
Cain escaped a bases-loaded jam in the second after three straight walks when the Giants turned a 3-2-3 double play on Jeremy Reed's hard grounder to first baseman Travis Ishikawa.
Mets shortstop Alex Cora left the game with a right thumb injury after sliding into second base on his first-inning double. Fernando Tatis replaced him for his fourth career game at shortstop and first since Sept. 13, 1998, at Houston while with the Cardinals.