LOS ANGELES — The San Francisco Giants left Dodger Stadium with their sweep, their revenge and their biggest National League West lead in nearly a month.

LOS ANGELES — The San Francisco Giants left Dodger Stadium with their sweep, their revenge and their biggest National League West lead in nearly a month.

They led wire-to-wire in the pivotal series against the Los Angeles Dodgers, which was capped by Wednesday night's 8-4 victory. The three-game sweep was the Giants' first at Dodger Stadium since April 2007.

Joaquin Arias drove in a career-high five runs, and Angel Pagan scored three times and picked up his third leadoff hit in three games. Pagan scored a first-inning run in all three victories, continuing a trend on the Giants' last two trips. In 13 road games this month, the Giants have scored a first- or second-inning run 12 times. Not coincidentally, they're 10-3 on the road in August and have moved 2 games ahead of the Dodgers.

It's the biggest lead the Giants have had since July 27, the day the Dodgers came into AT&T Park and kicked off a three-game sweep of the Giants. Thanks to strong starting pitching this week, the Giants were able to return the favor.

Matt Cain followed stellar outings from Madison Bumgarner and Tim Lincecum with a gem of his own, giving up just one run over seven innings. The trio gave up two combined runs in their three starts, with 19 strikeouts and just one walk.

Cain got three first-inning runs from a lineup that was missing Buster Posey, who sat out with right hamstring tightness. Pagan hit a leadoff double and scored on Pablo Sandoval's sacrifice fly. Two batters later, Arias hit a two-run homer to right, his second homer of the road trip.

Pagan and Arias were in the middle of another rally in the sixth. Pagan hit a leadoff single and scored on Sandoval's single, and Arias' RBI double made it 5-0. Pagan scored again in the seventh and Arias drove in two more runs with a double.

Posey was a late scratch from Wednesday's lineup because of tightness in his right hamstring. Posey felt slight tightness throughout Tuesday night's game and was removed as a precaution after grounding out to shortstop in the seventh inning of the Giants' 4-1 win over the Dodgers.

Manager Bruce Bochy said the injury isn't considered serious, and as the team was boarding the bus for Dodger Stadium, Posey told Bochy that he felt good enough to play in the series finale. But after running Posey through some tests, the training staff decided that he should take the night off.

"This is an easy decision," Bochy said. "He just feels something there, that's all. There's no pain."

Posey is hitting .408 in the second half with nine homers, 11 doubles and 36 RBIs, and has become firmly entrenched in the MVP race. With Posey sidelined, Hunter Pence moved up to the cleanup spot in the lineup and Hector Sanchez was tasked with catching Cain. The right-hander had thrown all 1672/3 of his innings to Posey this season, the highest total for any major leaguer who has pitched exclusively to one catcher.

The Giants are hopeful that Posey is able to return to the lineup today, when they open a four-game series with the Atlanta Braves at AT&T Park. Asked if Posey might have to play more first base in the coming days, Bochy said he felt that was unlikely.

"I don't see that happening, but if he feels (the tightness) in a squatting position, that could happen," Bochy said. "But at first base, there's a lot you have to do over there."

Notes: Closer Brian Wilson visited the clubhouse Tuesday and spent time with Bochy and the medical staff. Wilson, who had Tommy John surgery April 19, is scheduled to start throwing in October. ... First-round draft pick Chris Stratton will miss the remainder of Salem-Keizer's season, according to the Salem Statesman Journal. Stratton, a right-hander, was hit in the head by a line drive during batting practice Tuesday and spent the night in the hospital for observation. Stratton, 22, was selected 20th overall in June's draft. He had made eight appearances for Salem-Keizer in the short-season Northwest League, and had a 2.76 ERA and 16 strikeouts in 161/3 appearances. ... Right-hander Brad Penny is scheduled to begin a rehab stint with the Class-A San Jose Giants tonight. Penny was placed on the disabled list Aug. 14 with a right shoulder impingement. He has a 6.86 ERA in 15 relief appearances for the Giants this season.