Blaine Fisher / Getty Images for NBC News Marceline City Manager Luke Lewis says: "We're fortunate that we're able to dodge a financial bullet."

The small Missouri town where Walt Disney spent his boyhood has freed itself from an expensive electric power contract that threatened it with financial ruin and exemplified problems that some cities in the Midwest are having with a controversial coal-fired plant in Illinois.

Marceline, Mo., northwest of St. Louis, struck a deal last week to transfer the share of power that it gets from the Prairie State Energy Campus to the Missouri Public Energy Pool. Under the agreement, the city will pay $22,000 a month for the next four and a half years – down from the $100,000 a month it has been paying.

“We’re fortunate that we’re able to dodge a financial bullet,” Marceline City Manager Luke Lewis said Tuesday.

More than 200 cities, towns and utilities invested in the $5 billion plant in southern Illinois in the early to mid-2000s, hoping to protect against electricity price swings and save money in the long run. Peabody Energy developed the project – which it billed as a state-of-the-art power plant next to a high-sulfur coal mine – and eventually sold 95 percent of it to eight utility consortiums in nine states, though most of the cities are in Ohio, Missouri, Illinois and Indiana.

But construction cost increases, lower natural gas prices and other factors erased the project’s competitive advantage in the short term and left some of the cities with power that’s far more expensive than current market rates.

Marceline was perhaps the hardest-hit – it bought more power than it used at the time, expecting growth that never arrived. With uncertainty about when Prairie State would begin generating power, the town also contracted with another power provider, Ameren, through 2017.

So it was stuck making payments of more than $100,000 a month for Prairie State power it couldn’t use – a brutal hit to a city government with an annual budget of just $8 million. The deal reached last week, which will transfer its share of Prairie State power to the Missouri pool, will sharply reduce the flow of red ink.

“Instead of us losing $1.3 million per year, we’re going to be losing less than a quarter of that,” Lewis said. The city will also remain a member of the Missouri Public Utility Alliance, the parent of the energy pool. And Lewis said that Marceline's electricity customers won’t see a rate increase.

Read previous story: Small towns take their lumps after betting big on coal energy plant

Meanwhile, 540 miles to the east in Galion, Ohio, the City Council voted Tuesday night to ask the state attorney general to investigate how the Prairie State Energy project was sold to Ohio cities through American Municipal Power. Council President Don Faulds said that the mayor, an opponent of the resolution, could still veto it but that he was collecting documents to give to the attorney general's office.

More from NBC News Investigations:

Follow NBC News Investigations on Twitter and Facebook