Prior to their electric extra-inning comeback over the Oakland A’s in the American League wild card game on Tuesday night, the Kansas City Royals were the darlings of the 2014 Major League Baseball season. The downtrodden organization finally turned it around after years of setbacks and player departures, and now there is a sudden rush of optimism in western Missouri and Kansas, an area in which the Royals are just one of two major sports teams.

In 2013, Royal fans got an early preview of a much-needed change in fortune. The Royals won 86 games last season, but were still seven games back of the American League Central winner Detroit Tigers and six games back of Cleveland Indians, who earned a wild-card berth. Finishing in third place in arguably the least glamorous division in baseball would be reason to slump their collective heads, but for the Royals it was a step in the right direction.

Prior to 2013, the Royals had finished above .500 just three times, and only once reached second place in their five-team division in that span. It’s a poorly kept secret that small-market teams have a tough road to climb in competing with deep-pocket organizations likes the New York Yankees, Boston Red Sox, and even the Tigers. Despite the payroll handicap, the Royals’ struggles were disappointing even by low-payroll standards. While the Oakland A’s, Baltimore Orioles, Minnesota Twins, and Seattle Mariners enjoyed intermittent success over the past two decades, Kauffman Stadium has been perpetually empty in October.

In some ways, the Royals' futility has made them the American League version of the Pittsburgh Pirates. But unlike the Pirates, who were eliminated on Wednesday night by the San Francisco Giants in the National League wild card game, there was no rebuilding after a stretch of division titles. The Pirates reached the National League Championship series in the early 1990s, but would lose superstar Barry Bonds, ace Doug Drabek, and power hitter Bobby Bonilla to free agency, forcing the club to change course with young players who ultimately couldn’t return the club to glory. The Pirates finally reached the playoffs in 2013 after failing to finish with a .500 record for two decades, but the Royals had missed the postseason since 1985, when they won their first and only World Series since they joined the Majors in 1969. No team has had a postseason drought longer than the Royals.

General Manager Dayton Moore was viewed as the savior of the organization. High hopes surrounded the Wichita native when he took over in 2006 after the firing of Allard Baird, who had an unsuccessful six-year run that involved the trading away of stars Johnny Damon, Carlos Beltran and Jermaine Dye. Moore, a Royals fan since childhood, seemed determined to avoid the mistakes of Baird, but his deals, or lack of deals, provide few encouraging signs.

Moore managed to retain his position despite the Royals routinely losing 90 games a season, and often finishing fourth or fifth in the AL Central. After serving as an assistant with the consistently successful Atlanta Braves, Moore received the benefit of the doubt from many Royals fans at the start, but many grew tired of a “wait until next year” approach from Moore and David Glass, the club’s owner and chief executive officer.

In 2010, Moore traded star pitcher Zack Greinke to the Milwaukee Brewers for shortstop Alcides Escobar, outfielder Lorenzo Cain, and two pitching prospects. To Moore, the haul was a statement by the Royals that the years spent trying to put a winner on the field had finally paid off.

"We expect to be competitive next year," Moore said on the day of the Escobar-Cain acquisition.

Moore was wrong. In 2011, the Royals finished in fourth place with a 71-91 record. In 2012, they won 72 games. Meanwhile, blue chip corner-infield prospects Mike Moustakas and Eric Hosmer failed to lift the club. It also didn’t help matters that the Royals began the 2011 season with the lowest payroll ($36 million) in baseball.

But things turned around. The payroll surged to $60 million in 2012, $81 million in 2013, and $92 million in 2014. The results were seen on the field, as the Kansas City pitching staff was among the worst in 2011 but steadily improved. In 2013, the Royals had the best earned-run average in the AL. The bats climbed from finishing 20th in runs in 2012 to 18th in 2013. In 2014, the Royals were 14th in runs.

The long road to success often has plenty of bumps in the road, and the Royals have certainly had their share leading up to the 2014 postseason. Prized pitcher Luke Hochevar successfully transitioned from a starter to quality reliever, but not before suffering through five seasons with an awful earned-run average. The 29-year-old sat out the entire 2014 season with an elbow injury.

Glass’s patience in Moore’s vision, along with an uptick in payroll, are at last paying dividends. Kansas City currently boasts a collection of speedy players who have been crucial to manager Ned Yost’s “small ball,” a system that relies on speed on the base paths over power hitting.

In 2014, the Royals stole more bases (153) than any another team. Moore can be credited for the additions of veteran and unheralded outfielders like Norichikia Aoki and Jarrod Dyson, who have combined to steal 53 bases. Aoki, who joined the Royals after two seasons with the Brewers, has seen his home run numbers plummet under Yost, but his on-base percentage (.349) remains strong. Meanwhile, Dyson has been a valuable hitter off the bench.

The club also stuck it out with Alex Gordon, who was once considered a Rookie of the Year frontrunner in 2007. Gordon struggled in his first four seasons, prompting suggestions that he was a bust. In 2011, he lifted his home run total to 23 and his batting average to .303. The 30-year-old has not emerged into the superstar many thought he would be, but has continued to put up solid numbers in recent years.

Center fielder Lorenzo Cain is another example of the Royals’ wisdom in holding on to a developing player. Cain has been an improved batter in 2014, making use of his added playing time to lift his batting average, stolen base total and on-base percentage from previous seasons.

The Royals’ success has also come by mortgaging their future by trading prospects to the Tampa Rays for ace James Shields before the 2013 season. Shields has delivered with consecutive strong seasons and has been a legitimate No. 1 starter.

The other starters have done their part, as well. Yordano Ventura and Danny Duffy are two young stars who had exceptional 2014 seasons. Greg Holland has been among the best closers in baseball for the past two seasons, after serving as a dependable set-up man in 2011 and 2012.

Moore saw his plan coming to fruition before the start of the season. A top ace, a revamped starting rotation, and improved bats shifted the club's vision of looking years ahead, to one that could finally win in the present.

"We liked this team in spring training, but it wasn't a push-button club," Moore told ESPN baseball writer Jerry Crasnik. "We knew we were going to have to continue to make adjustments to the roster throughout the season, whether it was health or underachieving by certain players.

"No plan is perfect. If you could script it out, it would be great, but you can't. Baseball is a very tough, challenging game, and it requires mentally tough people at all levels. We didn't expect it to be all rosy. That's why it's a team. Players have to pick each other up."

Moore, who is now a candidate for the vacant Braves GM job, signed a two-year contract extension that will keep him with the Royals through 2016. His value to the Royals is not lost on the ownership.

“When Dayton’s contract was extended during the 2009 season, I felt that this franchise had begun to turn the corner and that we were pointed in the proper direction,” said Glass in a Nov. 2013 statement.

“It’s been a challenging process, but we are now seeing tangible evidence that the process is working, thanks to the tireless efforts of Dayton and his baseball operations staff. Dayton is not only an outstanding baseball man, but he’s very much a part of our family and one of the top individuals I’ve ever had the pleasure of working with.”

The journey isn’t over for the Royals even after the excitement of winning a dramatic wild-card game. On Thursday night, Kansas City will face the Los Angeles Angels in Game 1 of a best-of-five series, with the winner to face the winner of the Detroit Tigers-Baltimore Orioles series in the AL Championship Series.

The Royals will almost certainly continue to play small ball the rest of the postseason, with the hope of stealing wins like the victory over Oakland. When Moore watches the Royals face the Angels this week, he can appreciate the years of difficulty it took to reach the postseason. Few sports organizations have been through such an exhausting ordeal after winning a title, but it looks as though the Royals' troubles are behind them.

Sometimes patience pays off.

Kansas City Royals Vs. California Angels -- American League Division Series (Best of Five)

Game 1: Angels Stadium; 9:07 pm ET, Thursday, Oct.2, 2014 

Game 2: Angels Stadium; 9:37 pm ET, Friday, Oct. 3, 2014

Game 3: Kauffman Stadium, 7:37 pm ET, Sunday, Oct. 5, 2014

Game 4*: Kauffman Stadium, TBD, Monday, Oct. 6, 2014

Game 5*: Angels Stadium, TBD, Wednesday, Oct. 8, 2014

*If necessary