Updated

Hunter Pence homered and drove in two runs, Matt Cain tossed six strong innings and the San Francisco Giants spoiled Jason Hammel's debut for Oakland with a 5-2 victory over the Athletics on Wednesday night.

Cain (2-7) allowed two runs and five hits for his first win since May 15 against the Miami Marlins. He struck out four and walked two to help the Giants snap Oakland's six-game winning streak.

Hammel, acquired by the A's along with fellow right-hander Jeff Samardzija from the Chicago Cubs last week for three top prospects, disjointed the thumb on his glove hand but stayed in the game. He left after giving up six hits and three runs — two earned — in five innings, striking out three and walking three.

Stephen Vogt homered and Jed Lowrie had an RBI single for Oakland's only runs.