Madison Bumgarner smothered the Kansas City Royals for the second time in a week, pitching a four-hitter that led the San Francisco Giants to a 5-0 victory Sunday night and a 3-2 World Series lead.

Bumgarner struck out eight and walked none in improving to 4-0 in four World Series starts. He has allowed one run in 31 Series innings, an astonishing 0.29 ERA.

Brandon Crawford drove in three runs and Juan Perez hit a two-run double for the Giants, seeking to become only the second NL team to win three titles in a five-year span.

James Shields lost to Bumgarner for the second time, allowing eight hits and two runs in six innings.

In the 41 previous instances the World Series was 2-2 in the best-of-seven format, the Game 5 winner has taken the title 27 times. After a day off, the Series resumes Tuesday night at Kansas City's Kauffman Stadium. In a rematch of Game 2 starters, Jordano Ventura pitches for the Royals and Jake Peavy for the Giants.

Kansas City manager Ned Yost moved up Perez to the No. 5 spot in the batting order and dropped Moustakas to the No. 6 hole. That broke up lefties Eric Hosmer and Moustakas, who hit back-to-back in Games 3 and 4.

A night after overcoming a three-run deficit in an 11-4 victory that tied the Series, the Giants went ahead in the second against Shields, who is eligible for free agency and likely was making his last start for the Royals.

Hunter Pence grounded a hard smash off the glove of shortstop Alcides Escobar and into left field leading off, making him 8 for 16 in the Series. Brandon Belt reached on a bunt single to the left side of the overshifted infield, and both runners advanced on Travis Ishikawa's flyout to deep center.

Crawford grounded out to second as Pence scored, and Bumgarner's groundout to third ended the inning.

Pablo Sandoval singled leading off the fourth in perhaps his last home game for the Giants. He, too, can become a free agent next week. Ishikawa's single advanced Sandoval to second, and he scored when Crawford hit a soft single to center and Dyson, trying for a quick pickup and throw home, allowed the ball to deflect off his glove.

That set of another eruption for the crowd, most waving orange rally towels. Following championships in 2010 and '12, the Giants are seeking to join the 1942-46 St. Louis Cardinals as the only NL teams to win three titles in a five-year span.

San Francisco put two on with one out in the fifth, but Shields struck out Sandoval, and Pence's drive to deep right was run down by Lorenzo Cain two steps in front of the wall.

Shields allowed eight hits through six innings, struck out four and walked one.

The Giants added three runs off the first two-thirds of the Royals' vaunted bullpen in the eighth. Perez doubled in two runs and Crawford singled in another.

The rally sent Giants closer Santiago Casilla back to the bench. He was warming up in the eighth with a 2-0 lead. Instead, Bumgarner finished for his second shutout of this postseason.

The day marked the 29th anniversary of a special moment in Royals history: umpire Don Denkinger's blown call at first base helped Kansas City beat the Cardinals en route to their only World Series title.

Following batting practice on a sun-splashed afternoon, the ceremonial first pitch was thrown by Zak Williams, a son of late comedian and actor Robin Williams, who was a longtime Giants fan. The pitch was caught by Robin Williams' friend, Billy Crystal, and a video tribute was played.