Updated

SAN FRANCISCO (AP) — Aubrey Huff hit a pair of two-run homers, Matt Cain extended his winning streak to four consecutive starts and the San Francisco Giants beat the Oakland Athletics 6-2 on Sunday to complete a three-game series sweep.

Cain (6-4) allowed one run and eight hits over seven innings. He is 4-0 with a 0.55 ERA in four starts since his last loss May 22 at Oakland, when the A's got an unearned run off the right-hander in a 1-0 victory.

Jack Cust had three singles for Oakland, which dropped its sixth straight game at AT&T Park.

The Giants, who were swept by the A's last month in Oakland, improved to 8-4 in June after scuffling to a 14-14 mark in May. They moved a season-high eight games over .500 and pulled within 1½ games of first-place San Diego in the NL West.

Manager Bruce Bochy altered his lineup before the game, moving Pablo Sandoval into the No. 2 slot while dropping Juan Uribe to fourth in the order.

The changes worked nicely.

Sandoval walked in the sixth and scored on Huff's ninth homer. Uribe, batting cleanup for only the sixth time this season, followed with a drive to left to make it 4-1.

Sandoval also walked in the eighth before Huff hit a 2-2 pitch from Craig Breslow over the wall in right for his 10th career multihomer game.

Vin Mazzaro (2-1) pitched a season-best six innings for Oakland, yielding four runs, three earned, and six hits.

Cain ran his scoreless streak to 16 innings before Landon Powell hit a two-out RBI single in the fourth. Cliff Pennington then doubled to right but Powell was thrown out trying to score, ending the inning.

Cain pitched out of another jam in the sixth. With one out and runners at the corners, he struck out Adam Rosales and retired Powell on a bouncer to second.

San Francisco's bullpen nearly let Cain's latest gem get away. Reliever Dan Runzler's throwing error set up Kevin Kouzmanoff's RBI single in the eighth. Guillermo Mota then came in and walked two batters to load the bases before Santiago Casilla got pinch-hitter Mark Ellis to pop up for the final out of the inning.

The Giants grabbed a 1-0 lead in the second. Pat Burrell singled, took second on a throwing error by third baseman Kouzmanoff and scored on Bengie Molina's single.

NOTES: Oakland 3B Eric Chavez (neck spasms) told manager Bob Geren he is not yet ready to begin his minor league rehab assignment. ... Giants 2B Freddy Sanchez got the day off. ... Kouzmanoff extended his career-high hitting streak to 14 games.