Updated

Joaquin Arias belted a two-run homer in the opening inning and drove in a career-high five runs, and the San Francisco Giants completed a three-game sweep of the Los Angeles Dodgers with an 8-4 victory Wednesday night.

The Giants, who earned their first sweep of 3-or-more contests at Dodger Stadium since April 24-26, 2007, moved their lead to 2 1/2 games over Los Angeles atop the NL West.

Matt Cain (13-5) allowed seven hits and a run over seven innings to win his third straight start.

"Matt did a great job. He made pitches when he had to. The guys had great focus on defense," Giants manager Bruce Bochy said.

Angel Pagan had a pair of hits and scored three times, and Pablo Sandoval contributed two RBI for the Giants, winners in eight of their last 11 games.

Luis Cruz had two RBI for the Dodgers. Chris Capuano (11-9) surrendered six hits and six runs over five-plus innings to fall to 1-6 lifetime against the Giants.

Pagan doubled and Marco Scutaro singled prior to Sandoval's sacrifice fly to right field in the opening inning. One out later, Arias smacked a homer that skipped off the top of the wall in right-center field.

"Nothing really went our way this series," Dodgers manager Don Mattingly said. "They got us on the ropes instantly."

The Dodgers saw an opportunity wasted in the fifth inning. With men on second and third, Shane Victorino struck out to cap the frame.

Capuano retired 13 batters in a row until Pagan singled to left field to start the sixth. Scutaro hit a ground-rule double to left field prior to Sandoval's line RBI single to left field.

Shawn Tolleson gave up a one-out RBI double to left-center field by Arias. Justin Christian walked with the bases full later in the inning for a 6-0 margin.

Hanley Ramirez singled in Andre Ethier in the bottom of the sixth inning, but Arias stroked a two-run double to center field in the seventh for an 8-1 lead.

Christian made a diving catch in left field to rob Juan Rivera of a hit in the bottom of the frame.

Matt Kemp hit a ground-rule RBI double in the LA eighth. Jeremy Affeldt, making his 600th career appearance, came in to relieve Clay Hensley. Affeldt loaded the bases before Santiago Casilla gave up a two-run, broken-bat single to Cruz. A.J. Ellis, though, grounded into an inning-ending double play.

Game Notes

Cain moved to 4-8 lifetime against the Dodgers and has won his last four decisions against them. He's 3-0 with a 1.61 ERA over his last three starts overall ... Capuano has lost four of hits last five decisions ... The Giants lead the season series, 7-5.