Madison Bumgarner and the San Francisco Giants succeeded where no team had in 3 1/2 decades, winning Game 7 on the road for their third World Series title in five years.

Punctuating one of the finest October performances in baseball history, Bumgarner came out of the bullpen to pitch five scoreless innings on two days' rest for his third win of the Series, and the Giants held off the Kansas City Royals 3-2 Wednesday night in a championship pushed to the limit.

A two-out misplay in the ninth almost wrecked it for Bumgarner and the Giants. He had retired 14 in a row when Alex Gordon's single fell in front of center fielder Gregor Blanco, who let the ball get past him for an error that allowed Gordon to reach third.

Bumgarner, however, retired Salvador Perez on a foulout to third baseman Pedro Sandoval. The big left-hander was immediately embraced by catcher Buster Posey, and the rest of the Giants rushed to the mound to join the victory party. Most of the San Francisco players tossed their gloves high in the air as they ran to the center of the diamond.

Three days after throwing 117 pitches in a four-hit shutout to win Game 5, Bumgarner threw 68 more and dropped his record-low career Series ERA to a barely visible 0.25.

He joined Arizona ace Randy Johnson (2001) as the only pitchers in the expansion era to win three games in one Series.

Michael Morse hit a go-ahead single in the fourth that stood up, and the Giants eked out a battle of the bullpens on a night when both starting pitchers made unusually quick exits.

The Giants were dubbed a "Band of Misfits" in 2010 when they beat Texas to win the franchise's first title since 1954 in New York. Two years later, they swept Detroit for another championship.

And this time, they became the second NL team with three titles in a five-year span, matching Stan Musial's St. Louis Cardinals of 1942-46.

Every other year. It's the closest thing to a dynasty baseball has seen in the 21st century.

Home teams had won nine straight Game 7s in the Series since Pittsburgh's victory at Baltimore in 1979, including the Royals' 11-0 rout of St. Louis in 1985. Teams hosting the first two games had won 23 of the last 28 titles, including five in a row. And the Giants had lost all four of their previous World Series pushed to the limit.

But before a pumped-up, blue-and-white-clad crowd of 40,535 that hoped noise and passion could lift the small-market Royals to a title that seemed improbable when Kansas City was languishing two games under .500 in mid-July, the Giants won the second all-wild card World Series, 12 years after losing Game 7 to the Angels in the first.

Both managers promised quick hooks if their starters showed the slightest signs of faltering, and both managers delivered as Tim Hudson and Jeremy Guthrie combined for 15 outs — matching the fewest by Game 7 starters. Hudson, at 39 the oldest Game 7 starter, allowed two runs in 1 2-3 innings. The 35-year-old Guthrie took the loss, giving up three runs in 3 1-3 innings

Jeremy Affeldt followed Hudson with 2 1-3 innings of scoreless relief in his longest outing since July 2012, getting help from the first successful replay challenge in World Series history.

With his shaggy hair making him look every bit a gunslinger, Bumgarner entered to boos in the bottom of the fifth, coated his long arms with rosin and groomed the pocked-up mound with his spikes.

He gave up an opposite-field single to his first batter, Omar Infante, who advanced on a sacrifice. Bumgarner retired Nori Aoki on a liner near the left-field line that was grabbed by Juan Perez, starting over Travis Ishikawa because of his defense. Bumgarner then struck out Lorenzo Cain.

He retired the side in order in the sixth, seven and eighth, increasing his pitch count to 52. With loud chants of "Let's Go Royals!" echoing through Kauffman Stadium, he struck out Eric Hosmer to open the ninth, then retired Billy Butler on a foulout to bring up Gordon.

The 25-year-old Bumgarner allowed two hits, struck out four and walked none. He pitched 52 2-3 postseason innings, 4 1-3 more than the previous mark set by Arizona's Curt Schilling in 2001, and finished with 270 innings combined, including the regular season.

Voted the Series MVP, MadBum became king of SoMa, and from Nob Hill to North Beach, from The Marina to The Mission, San Francisco celebrated another title won by Kung Fu Panda and Hunter Pence.

Pence batted .444 in the Series and Sandoval, a free-agent-to-be playing perhaps his last game for the Giants, finished at .429 following a three-hit night. In an era when pitching and computer-aided defense has supplanted steroids-saturated sluggers, baseball's dominant team established itself in the tech-fueled, boomtown by the Bay.

The Giants, a 20-1 longshot when 2014 odds were first posted a year ago, won their eighth title and third since moving from New York to San Francisco after the 1957 season. They also have won 10 straight postseason rounds, one shy of the record set by the New York Yankees from 1998-01.

After finishing tied with Pittsburgh in the wild-card race at 88-74, the Giants advanced when Bumgarner pitched a four-hit shutout and then beat Washington and St. Louis in the NL playoffs.

Bruce Bochy became the 10th manager to win three World Series titles — the other nine are all in the Hall of Fame.

Sandoval was hit just above the right elbow leading off the second, Pence reached out and pulled an 0-2 changeup into left for a single and Brandon Belt poked a single into right, loading the bases.

Consecutive sacrifice flies by Morse and Brandon Crawford put the Giants ahead 2-0.

But Hudson gave the lead right back and was chased after 28 pitches, walking off the mound with a stunned look when Bochy removed him after just four outs — the shortest Game 7 start since the Yankees' Bob Turley was pulled after a leadoff single in the second in 1960.

Kansas City pressured Hudson in a three-pitch span when Billy Butler singled leading off, Gordon lined the next pitch to right-center for an RBI double and Perez was hit by a pitch.

Gordon scored on Infante's sacrifice fly for a 2-all tie.

THE CORE

Eight players have been on all three Series rosters for the Giants in the past five years: Affeldt, Bumgarner, Santiago Casilla, Tim Lincecum, Javier Lopez, Posey, Sergio Romo and Sandoval. Matt Cain, a member of the first two title teams, was hurt this October. Before this run, manager John McGraw (1905, '21-'22) was the only Giant with three titles.