Updated

Ryan Vogelsong tossed seven solid innings and the San Francisco Giants snuck past the road-weary Chicago Cubs, 3-2, to complete a four-game sweep.

Vogelsong (4-2) gave up two runs on eight hits while striking out three for the Giants, who went 6-1 on a seven-game homestand.

"I felt like that was definitely the best all-around stuff I had," Vogelsong said. "It's kind of surprising I let up that many hits, but that was probably the best I've felt stuff-wise this season."

The key to their success on the homestand was solid starting pitching. Giants starters have now gone seven consecutive games tossing seven or more innings while allowing two runs or fewer. The only other time since 1958 they've done so for at least seven such starts was between July 1-10, 1988 (nine games).

Brandon Crawford had two RBI for the Giants, who earned their first four-game sweep over the Cubs since June 17-20, 1999, at Candlestick Park. In addition, Angel Pagan went 2-for-4 to extend his home hitting streak to 28 games, the longest home hitting streak in Giants franchise history (since 1900).

Jeff Samardzija allowed two runs on seven hits over five frames for the Cubs, who have dropped 11 in a row on the road. Chicago last lost more than 10 straight road games in a single year during an 11-game drought from June 18-29, 1954.

Carlos Marmol (0-2) gave up one run on one hit while walking two in the seventh inning to take the loss.

Marmol entered with the game tied at two. Buster Posey walked, Pagan reached base on an infield single and Brandon Belt walked to load the bases with no outs. Joaquin Arias then grounded into a double play, but the go-ahead run crossed the plate. James Russell came in from the bullpen and got Crawford swinging to keep it 3-2.

Jeremy Affeldt tossed two perfect innings for his first save of the season.

The Cubs put two runs on the board in the second. Bryan LaHair and Darwin Barney singled to put men on the corners with two outs. Steve Clevenger and Samardzija followed with back-to-back RBI singles to make it 2-0.

San Francisco managed to get one run back in the bottom of the frame. Belt and Arias started the inning with consecutive singles and Crawford knocked in Belt with a double to right. The home team went on to load the bases with one out, but Samardzija retired Ryan Theriot and Melky Cabrera to limit the damage.

The Giants were able to tie the game in the fifth, thanks to a mental error from Starlin Castro. Posey walked, Pagan singled and Belt walked to load the bases with no outs. After Arias lined out, Crawford hit a grounder to second baseman Barney. The second baseman flipped the ball to Castro, who was covering second, in hopes of starting a double play. Instead of throwing to first, Castro started to jog off the field thinking the inning was over. The tying run scored on the play.

"It's very embarrassing," Castro said. "I apologized to my team and everybody. That kind of thing is not supposed to happen."

Game Notes

Chicago has not won in an opponent's ballpark since defeating St. Louis, 6-4, on May 14...In 15 lifetime meetings with the Cubs, Vogelsong is 4-5...The Cubs head to Milwaukee on Tuesday to start a three-game set, while the Giants go to San Diego for a three-game series starting Tuesday.