San Francisco's Matt Cain was far from flawless in his first outing since pitching a perfect game but he did enough to win his eighth straight start, leading the Giants to a 5-3 win over the Los Angeles Angels on Monday.

After becoming the 22nd pitcher to throw a perfect game against Houston last week, Cain allowed three runs over five innings to get the win and improve to 9-2 on the season.

Cain was not at his best, walking four and giving up a second-inning home run to Mark Trumbo, but he got plenty of support from the bullpen and offense.

Angel Pagan broke a 2-2 tie with an RBI in the third inning, before Ryan Theriot added run-scoring singles in the fourth and sixth to give the visiting Giants (38-30) control.

Four San Francisco relievers combined on four hit-less innings and the Giants retired 15 straight Angels' batters to end the game.

Los Angeles starter Jerome Williams, who pitched for San Francisco from 2003-2005, allowed four runs in 3 1/3 innings and was later taken to the hospital for shortness of breath.

The Angels (36-32) reported it was just a precautionary measure.

(Writing by Jahmal Corner in Los Angeles; Editing by Peter Rutherford)