The Kansas City Royals have waited nearly three decades to return to the postseason. At about 12:53 am on Wednesday, they gave their fans a reason to appreciate the journey with a come-from-behind victory over the Oakland A’s in a 12-inning thriller at Kauffman Stadium in the American League wild-card game, 9-8.

With two outs, Salvador Perez ripped a breaking ball from Jason Hammel that just barely found its way beyond the diving outstretched arm of third baseman Josh Donaldson to drive in Christian Colon for the game-winning run. Much of the packed house of 40,502 were in a state of delirium after the 4-hour 45-minute marathon that featured many highs and lows for the home team.

After falling behind 7-3 and staging an eight-inning comeback, the Royals trailed 8-7 entering the 12th, but their fortunes turned with Eric Hosmer’s triple with one out. He would score to even the game on a chopper by Colon.

“This will go down as the craziest I’ve ever played,” said Hosmer, who finished with three hits in four at-bats.

There was plenty of second-guessing in the game, as well. Royals manager Ned Yost heard it from the crowd for pulling ace James Shields in the top of the sixth inning for Yordana Ventura. The rookie then served up a three-run home run to Brandon Moss, his second homer of the game, and Oakland would score two more in the sixth with singles off Kelvin Herrera.

Yost said he "wanted to bring the gas" to put in his power arms to replace Shields.

In the eighth inning, the Royals would score three runs off starter Jon Lester and Luke Gregerson to cut the lead to 7-6. In the ninth, normally reliable closer Sean Doolittle conceded a run off a sacrifice fly from Norichika Aoki to send the game to extra innings.

In the top of the 12th inning, A’s pinch hitter Alberto Callaspo singled home Josh Reddick to give Oakland the lead. But the A’s couldn’t hold on.

A’s manager Bob Melvin, a former catcher, may have felt particularly frustrated by the way Oakland surrendered a four-run led. The Royals, arguably the speediest team in baseball, had seven players who stole a base, and five of them scored. The seven stolen bases ties a postseason record dating back to the 1907 Chicago Cubs.

Indeed, Kansas City used “small ball” to beat Oakland. Of the Royals’ 15 hits, only two were for extra bases.

“We have a team who likes to run," said Perez.

The Royals, who are coming off the longest postseason drought in the majors, will face the Los Angeles Angels on Thursday at Angel Stadium.