BASEBALL thought it had the perfect fairytale ending to the 2014 season all figured out.

Derek Jeter, the legendary New York Yankees shortstop, was retiring after 19 years in the Bronx and what better way would there be for him to bow out than by leading his team to another World Series success. Were Jeter to earn his sixth WS ring by batting in the winning run - a homer ideally - then all the better.

It never materialised, of course. The Yankees are no longer the all-conquering force they once were and, for a second year in succession, failed to qualify for the end-of-season play-offs. A meaningless match against great rivals the Boston Red Sox - who also endured a year to forget - was not how Jeter would have envisaged his exit from the sport.

Instead, however, an even greater baseball story has emerged, one even less likely than Jeter taking his leave on the highest of highs. It is a story of perseverance, a heart-warming tale of how, eventually, even the lowliest of underdogs has its day. And it is not finished yet.

The heroes of this particular miracle are the Kansas City Royals who this evening will open the best-of-seven World Series at home to the San Francisco Giants. It is a day only the most optimistic Royals fans could ever have envisaged. The last time their side qualified for the play-offs was 1985. They went all the way that year but the subsequent period has brought nothing but misery for the team from Missouri, their failure to reach the post-season for 28 seasons an unwanted Major League Baseball record.

It has been a period of unrelenting hardship. Year upon year, the Royals - a small-market team on a limited budget - would find themselves struggling around the foot of their division. More often than not they would finish rock bottom (MLB, like most American sports, does not have relegation, much to the Royals' relief), with not even a switch from the American League's West to Central division improving their fortunes. In 17 out of 18 seasons they lost more games than they won, some years to an embarrassing degree. In 2005 they lost 106 of their 162 games to finish 43 games (victories) behind the division winners. The prospect of them ever playing baseball in October again seemed very slim indeed.

It has all turned around this season, however. If there were signs of improvement last year, when they posted a first winning record (86-76) in a decade, then they have jumped on that platform and leapt to even greater things. A storming second half of 2014 caused them to finish in second spot in the division to finally qualify for the post-season after 29 long years.

That was just the start of the drama for manager Ned Yost and his players. In the one-off wild card game against the Oakland Athletics, they rallied from 7-3 down in the eighth inning to win 9-8 after 12. Their next opponents in the best-of-five AL Division Series were the Los Angeles Angels of Anaheim, the team with the best record in the MLB during the regular season. Again the Royals surpassed all expectations, winning the first two games in extra innings then completing the sweep at home in Game 3.

At this point, all logic had been suspended and all bets were off. Next to try to stop this juggernaut were the Baltimore Orioles in the best-of-seven AL Championship Series. The O's had beaten the Yankees and Red Sox to win the AL East division title but they were no match for a Royals team gathering momentum like a snowball rolling down a mountain. Again, Kansas City did it with minimum fuss, picking up another MLB record in the process as the first team to win eight post-season games in a row. For a shell-shocked Royals support, there was joy unrefined.

"It's just one of those stories of players playing well as a team, and every game has been exciting," said actor Paul Rudd, star of Anchorman and a lifelong Royals fan. "I'm gonna be partying at my mom's house. She's out of town and I've got a keg."

Now there is just the small matter of the World Series itself. Standing in Kansas City's way are the Giants, champions in 2010 and 2012 and favourites to clinch a third title in five years. The rest of the country, however, will be rooting for the Royals. The fairytale ending to end all fairytales is just four wins away.