James Shields became "Tough Luck James" in Game 5 of the World Series.

Shields bounced back from a shaky start in the Series opener with his best outing of the postseason only to be done in by Madison Bumgarner's brilliance and a few soft hits in Kansas City's 5-0 loss to the San Francisco Giants on Sunday night.

"I was pounding the strike zone, I had better angle on my ball and I was getting swings and misses today," Shields said. "Unfortunately, we ran into a really good pitcher today."

Shields allowed two runs in six innings to take his second loss of the Series and send the Royals back home trailing 3-2. This is the same hole they faced their last trip to the Series in 1985, when they recovered to win the final two games over St. Louis for their only championship in franchise history.

To get a repeat of that comeback, the Royals will need to be better than they were the final two games in San Francisco, when they got outscored 15-0 after taking an early 4-1 lead in Game 4 that had them on the verge of taking control of the Series.

"We know we can do it," first baseman Eric Hosmer said. "We're a confident group. But we can't do anything without winning Game 6. We're excited to get back home where we feed off the fans and that energy."

But a bullpen meltdown on Saturday night and a lineup that was unable to solve Bumgarner in Game 5 has left the Royals on the brink of elimination despite the solid effort from Shields in what could be his final appearance with the Royals. Shields is eligible for free agency at the end of the Series.

Shields had earned the nickname "Big Game James" early in his career but has rarely lived up to it in October as his 5.74 ERA in 10 postseason starts coming into the game was the sixth highest of all-time.

Shields has particularly struggled this year, allowing 15 runs in 19 innings over his first four starts before settling down his second go-around against the Giants. He got lit up by the Giants in the opener when he said he was too "amped" up, allowing three runs in the first. Overall, he yielded five in three innings in the shortest postseason start of his career.

After tinkering with his mechanics between starts, Shields managed to go six innings in the rematch despite allowing eight hits. All of them were singles and few were hit hard but they did enough damage to hand Shields another loss.

"I felt like I had a lot better direction today," Shields said. "I think they had one hard hit ball today. The rest they found holes."

Hunter Pence reached on a single off shortstop Alcides Escobar's glove to lead off the second and advanced when Brandon Belt dropped a bunt single toward third to beat the infield shift. The runners advanced on a deep fly and Pence scored on Brandon Crawford's groundout as manager Ned Yost kept the infield back early in the game.

Shields allowed another leadoff single in the fourth, to Pablo Sandoval. Before striking out the next two batters. Sandoval advanced to second on Travis Ishikawa's single and scored on Crawford's soft single to center that Jarrod Dyson couldn't pick up cleanly in an attempt to stop Sandoval from scoring.

That's all the damage the Giants would do against Shields, who was helped out by a running grab in deep right-center by Lorenzo Cain that robbed Pence of an extra-base hit with two on and two outs in the fifth.

But it was more than enough to do in the Royals on a night where they managed just four hits off Bumgarner.

"He kept us in the game and he threw great," Hosmer said. "Offensively we couldn't get anything going."