TOPEKA, Kan. (AP) — A southeast Kansas town has lost its latest bid to retry a class-action lawsuit claiming BP of North America should do more to clean up industrial pollution from a refinery that closed in 1970.

The Kansas Court of Appeals on Friday rejected the request from residents and officials of Neodesha, who sued in 2004 for more than $478 million in cleanup costs plus damages.

A jury in Wilson County ruled for BP in 2007, finding that BP had fulfilled its duty to clean up contamination traced to the refinery that operated from 1897 until it was dismantled in 1970. But the trial judge set the verdict aside in 2008, concluding he gave jurors improper instructions.

BP appealed the judge's action and the Kansas Supreme Court reinstated the jury's verdict in 2012. The plaintiffs then filed for a new trial based on new arguments about errors in the first proceeding, which lasted 17 weeks.

In its ruling Friday, the Court of Appeals acknowledged problems in the way the initial trial was conducted, The Topeka Capital-Journal reported ( ).

"We cannot conclude that this was a perfect trial, but we see no good reason to conclude that the court should have granted a new trial," Judge Stephen Hill wrote on behalf of the three-judge panel.

The relationship between Neodesha and BP has been contentious since the closing of what was then the Amoco Oil refinery, which was originally built by Standard Oil. The loss of Neodesha's principle industry for some 70 years threatened the economic viability of the southeast Kansas community of 2,700 residents.

Amoco Oil closed the refinery after the advent of federal clean-air laws. The city used $5,000 in Amoco money to demolish some refinery structures and begin development of an industrial park that eventually provided some replacement jobs.

After tests by state and federal officials showed high levels of contaminants in water both above and below the ground in Neodesha, BP — which purchased Amoco in 1998 — began its own cleanup effort to meet state standards.

But local government officials and residents filed suit six years later, concerned that toxic materials still threatened much of the town.