SAN FRANCISCO — Clayton Kershaw struck out seven over seven innings in another impressive performance in San Francisco's home ballpark, and the Los Angeles Dodgers beat the Giants 2-1 Tuesday night to end a four-game losing streak against their rival.

Buster Posey extended his hitting streak to 11 games with an RBI single in the third that put the Giants ahead, but then Yasiel Puig singled in a run in the fourth and Adrian Gonzalez's groundout drove in another.

The Dodgers, who were on the other end of a 2-1 result a night earlier, also ended a six-game skid at AT&T Park to avoid matching the franchise's longest winless stretch in San Francisco from April 21-Sept. 28, 2015.

Lefty Ty Blach (0-1) allowed two runs and four hits in five innings making his first start in place of injured Madison Bumgarner. The ace southpaw bruised his ribs and sprained the AC joint in his pitching shoulder in a dirt bike accident last Thursday during a day off in Colorado.