Pittsburgh, PA (Sports Network) - Matt Cain pitched 6 2/3 scoreless frames and Hunter Pence hit a three-run homer as the San Francisco Giants crushed the Pittsburgh Pirates, 10-0, to salvage a win in the finale of a three-game set at PNC Park.

Pitching on the one-year anniversary of his 2012 perfect game versus the Houston Astros, Cain (5-3) gave up just two hits and two walks and struck out three while improving to 5-1 over his last eight starts.

"He gave us what we certainly needed," said Giants manager Bruce Bochy. "Matt (Cain) has been on a good roll from his last start, this start, he's throwing the ball really well."

Gregor Blanco and Buster Posey each drove in two runs for the Giants.

Pirates starter Charlie Morton (0-1), who had been sidelined for more than a year thanks to right elbow inflammation which eventually required Tommy John surgery, allowed four runs -- two earned -- on seven hits and plunked three over five frames to absorb the loss.

"He did some things well and he's got some areas that I think he'll be able to improve upon," said Pittsburgh manager Clint Hurdle. "I think there was some nervousness in the first inning."

Pittsburgh, which had won four of five coming in, was also looking for its first sweep of San Francisco since May 6-8, 2008.

Cain eased through the first four frames and failed to allow a hit. The only Pirates to have success against him were Garrett Jones and Andrew McCutchen, who hit a single and double, respectively, in the fifth and seventh inning. However, by then the damage had already been done.

San Fran's right-hander received plenty of early support, as Morton got off to a rough start by walking and plunking the first two batters he faced. Posey's RBI single in the first gave San Francisco a 1-0 lead.

Blanco's run-scoring single in the second added another run and the Giants' offensive outburst continued into the fifth.

Pence's fielder's choice plated the first run of the fifth and after Morton plunked his second batter of the frame, Brandon Belt, Andres Torres smacked a sacrifice fly to make it 4-0.

The Giants tacked on five more runs in the sixth versus Morton's replacement, Mike Zagurski.

Blanco added a one-out RBI single and Brandon Crawford followed with a base hit. Posey made it 6-0 with an infield chopper to short, scoring Blanco and Pence blew the game open with a three-run blast into the bullpen in left- center, giving the visitors a 9-0 advantage.

Crawford's sacrifice fly in the ninth accounted for the visitors' final margin.

Game Notes

Prior to the game, the Bucs placed pitcher A.J. Burnett on the 15-day DL (retroactive to June 9) and released hurler Jose Contreras ... Morton's last outing came on May 29, 2012 ... Pence leads the Giants with 11 homers this season ... San Francisco improved to 13-20 on the road this season ... Morton took the start in place of the injured Wandy Rodriguez ... Pittsburgh finished with three hits.