San Francisco, CA (SportsNetwork.com) - Madison Bumgarner got the best of Clayton Kershaw once again, this time at the plate as well as on the mound.

Bumgarner homered off Kershaw and turned in 6 1/3 scoreless innings to lead the San Francisco Giants to their third consecutive shutout of the Los Angeles Dodgers, a 4-0 decision that completed a series sweep of their NL West rivals.

"We kind of kid around with the pitchers sometimes that if you want to win the game, throw a shutout and hit a homer," Giants manager Bruce Bochy said. "(Bumgarner) was trying to do that."

The third showdown between the two aces this season wound up much like the first two, a narrow San Francisco victory. The result was also similar to the Dodgers' recent outcomes, as they've mustered a paltry two runs in dropping four of their last five contests.

Los Angeles had its chances against Bumgarner (5-2), who permitted seven hits and a pair of walks but worked out of every jam. The Dodgers left 10 on base and went 0-for-7 with runners in scoring position.

"I thought our at-bats were really good today early, actually all the way through the game," Dodgers manager Don Mattingly remarked. "We had a lot of guys out there. We really made Madison pitch. We just weren't able to get the hits to be able to push some runs across."

Hunter Pence contributed a pair of RBI singles for the Giants, now 6-0 against Los Angeles at AT&T Park this season. Angel Pagan also had two hits while scoring twice.

Kershaw (2-3) was charged with all four runs and struck out seven before being removed with one out in the eighth.

Bumgarner stranded two runners in three of the first five innings and allowed the leadoff man to reach in the second and third, when the Dodgers had their best scoring chance when Joc Pederson led off with a bloop double and took third on Enrique Hernandez's grounder.

The 2014 World Series MVP thwarted the threat, however, by getting Howie Kendrick to ground out softly with the infield pulled in and retiring Adrian Gonzalez on a fly ball.

Bumgarner took matters into his own hands while batting in the Giants' half of the inning, jumping all over Kershaw's initial pitch and sending it 415 feet into the left-field seats for his seventh career homer.

"He's the best pitcher in baseball," Bumgarner said of Kershaw. "To be able to do that and run into one, it's pretty special."

Pagan's double to begin the bottom of the fourth led to San Francisco's second run. Pence delivered a single to right two batters later, with Pagan averting A.J. Ellis' tag at the plate for a 2-0 lead that held up after a replay review.

Kershaw kept it a two-run game until the eighth, in which Giants reliever Sergio Romo induced a double-play grounder from Alex Guerrero to end the Dodgers' portion of the inning and San Francisco created some distance in the home half.

After back-to-back one-out singles from Pagan and Buster Posey triggered Kershaw's exit, Pence and Brandon Crawford came through with run-scoring hits to extend the margin to 4-0.

Game Notes

The Giants have won five of the six all-time matchups between Bumgarner and Kershaw. Bumgarner owns a 4-1 record and Kershaw a 1-4 mark in those meetings ... San Francisco has won six straight at home from the Dodgers for the first time since June 1-Sept. 13, 1972 ... The shutout was the Giants' seventh in May, the most in a single month since the franchise moved to San Francisco ... Posey's single in the eighth stretched his hitting streak to 13 games ... Bumgarner's homer was the first allowed by Kershaw in 411 plate appearances against pitchers.