KANSAS CITY, Mo. — It was quite a start to October baseball, even though this one appeared to be over in September.Salvador Perez hit a two-out RBI single to cap a two-run rally in the 12th inning, and the Royals defeated the Athletics 9-8 on Tuesday night to win the American League wild-card game.Kansas City, in its first postseason since winning the World Series in 1985, heads to Anaheim to face the AL West champion Angels in the Division Series. Game 1 is Thursday.Alberto Callaspo had put Oakland ahead 8-7 in the top half, and it looked as if the A's would finally hang on after blowing a four-run lead.Josh Reddick led off the 12th with a walk off Brandon Finnegan, who was working his third inning. After Jed Lowrie's sacrifice, Jason Frasor relieved and threw a wild pitch that sent Reddick to third. Callaspo then laced a single into leftfield, scoring Reddick.But Kansas City came storming back. With one out, Eric Hosmer hit a drive off the left-centerfield wall off Dan Otero and raced to third when leftfielder Jonny Gomes and centerfielder Sam Fuld collided trying to make the catch. Hosmer scored on Christian Colon's infield single.Fernando Abad relieved and got Alex Gordon to foul out to third. Then former Ray Jason Hammel came on, and after Colon stole second (when catcher Derek Norris dropped the pitchout), Perez grounded one just out of the reach of diving third baseman Jason Donaldson.The A's raced out to a 7-3 lead by the sixth inning, but the Royals countered with three runs in the eighth. Nori Aoki's sacrifice fly off Sean Doolittle in the ninth forced extra innings.Kansas City, appearing in its first playoff game in 29 years, had a chance to score the winning run in the 10th. Perez grounded out with Hosmer on third base to end the inning.The A's late-inning meltdown in some ways mirrored a second-half collapse that forced them to claw their way into the playoffs on the final day of the regular season.A much-anticipated pitching showdown between Oakland ace Jon Lester and Kansas City counterpart James Shields turned into a high-scoring game.The A's showed off their power, while the Royals used their speed.Brandon Moss helped the A's strike first, belting a two-run homer in the first inning and a three-run shot in the fifth. The Royals countered by playing small ball, stealing six bases and clawing back from a four-run deficit over the final two innings.The impassioned play by a scrappy bunch of Royals that have rarely tasted success energized a sellout crowd that had been pining for postseason baseball since the 1985 World Series.Then again, maybe it was the crowd that energized the Royals.Oakland had built a 7-3 lead after the fifth, and Lester — long a thorn in Kansas City's side — had started to hit his stride. But A's manager Bob Melvin opted to send him out for the eighth inning, and the Royals finally got Lester into a real jam.Luke Gregerson entered in relief but failed to provide much. By the time he struck out Perez and Omar Infante to leave runners on second and third, the four-run lead was down to one.Sean Doolittle tried to finish it in the ninth, but he gave up a bloop single to pinch-hitter Josh Willingham. Pinch-runner Jarrod Dyson was sacrificed to second and then brashly stole third, allowing him to score on Aoki's sacrifice fly to deep rightfield.By that point, a series of blunders by the Royals and manager Ned Yost had become moot.The first occurred in the first inning, when slow DH Billy Butler was caught wandering off first base on an attempted steal with a runner on third. Hosmer broke late for the plate and was thrown out easily.In the sixth, Yost yanked Shields and called on Yordano Ventura. The rookie promptly served up Moss' go-ahead three-run homer.