WICHITA, Kan. (AP) — The Kansas Supreme Court reinstated on Friday a jury verdict that said residents of Neodesha are not entitled to recover cleanup costs from BP Corp. caused by a refinery that closed 42 years ago, a ruling that sided with Big Oil.

The high court said the judge made a mistake when he overturned the jury's decision following one of the longest jury trials — 17 weeks — held in Kansas. The judge had set aside the verdict after concluding he had given jurors improper instructions, saying jurors should only have been instructed to determine damages.

In 2008, Allen County District Judge Daniel Creitz said that strict liability for the contamination was not a question of fact for the jury to decide but a question of law — and that Neodesha, located in rural southeastern Kansas, was entitled to judgment in its favor. He ordered a new trial only on the issue of damages, and BP appealed.

In its 34-page ruling, the Supreme Court said Friday that BP was correct in arguing that there were disputed facts that jurors had to decide, such as whether BP had done enough to clean up the pollution.

"Given the allegations as framed and the existence of disputed facts, we hold that the jury's verdict should not have been disturbed," the court wrote.

Experts found groundwater pollution under 350 acres of land — including almost 70 percent of the town and land underneath City Hall, hundreds of homes and the community's schools. The lawsuit contended the operation of the oil refinery and associated labs and storage facilities generated a variety of poisonous wastes and metals.

Neodesha city manager Allen Dinkel declined comment on the Supreme Court opinion, saying their attorney was reviewing it.

Rochelle Chronister, a Neodesha resident and former state legislator who attended most of the trial, wrote in an email, "Looks like we lost big time!"

But BP said it was pleased the court's decision, saying the jury had carefully reviewed the facts and reached "the proper verdict" in BP's favor. The verdict reflected the findings of an independent government study that confirmed the contamination from the former Amoco refinery poses no apparent public health hazard, according to an emailed statement.

"Our goals for the project remain the same, no harm to people or the environment, and the completion of the clean-up of the site, which has already been returned to productive use," BP said.

The original lawsuit was filed in 2004 on behalf of the 2,700 residents, as well as government entities and businesses. The lawsuit claimed the corporation lied when it told the community it knew where the contamination was located, when it said the contamination was stable, and when it told residents there was no risk.

Plaintiffs had sought nearly $478 million for cleanup costs and damages as well as punitive damages.

The refinery operated from 1897 until it was dismantled in 1970 and the property was donated to the city. It had been owned and operated by Standard Oil Co., and its corporate successors.

Defendants contended at trial that they had already assumed full responsibility for addressing the contamination caused by the refinery and committed publicly to remedial actions that the Kansas Department of Health and Environment deemed appropriate.

At trial, which began in August 2007, the companies argued the state agency has been reviewing the company's work and did not have a problem with the progress of its cleanup.

There were 46 witnesses over 69 days of testimony. Jurors reached their decision after less than three days of deliberations.