A US judge has upheld oil company Chevron's allegations that an Ecuadorian court decision ordering it to pay $9.5bn for oil pollution in the Amazon jungle was fraudulently obtained.

US District Judge Lewis Kaplan concluded on Tuesday that plaintiffs in the 2011 case and their lawyers committed a host of corrupt actions, including ghost-writing the original judgment, submitting fraudulent evidence and bribery.

Witnesses in the case included a former Ecuadorian judge, who admitted to accepting bribes.

In barring enforcement of the original fine in US courts, the decision handed Chevron a victory in its long fight with Ecuador.

"Justice is not served by inflicting injustice. The ends do not justify the means," Kaplan wrote.

He said it was a sad outcome to have to rule that the Ecuadorian court judgment "was obtained by corrupt means", because it would perhaps never be known whether there was a case to be made against Chevron.

Kaplan concluded that Chevron "might bear some responsibility" for pollution in Ecuador. "It is distressing that the course of justice was perverted," he wrote in a nearly 500-page ruling that followed a trial last year.

The verdict was a setback to the indigenous people from Ecuador's oil-rich Lago Agrio in the eastern region of Oriente, who have long sought compensation for pollution by US oil company Texaco between the 1970s and early 1990s.

Oilfield waste dumping

The indigenous people allege that Texaco, which was bought by Chevron in 2001, dumped oilfield waste that polluted large parts of the jungle region, causing widespread sickness and a surge in deaths from cancer.

Chevron has insisted it cannot be held responsible, and argued that corruption underpinned the huge fine ordered by the Ecuador court.

Kaplan said Steven Donziger, the New York lawyer who has represented the Ecuadorian plaintiffs since the 1990s, and his allies secretly paid off the authors of an ostensibly independent report on the pollution damages that was requested by the court.

Representatives of the plaintiffs and Donziger promised to appeal against the ruling.

"Today's decision should be extremely troubling for anybody who cares about the rule of law," Deepak Gupta, who will represent Donziger in the appeal, said.

Kaplan's ruling bars the Ecuadorian plaintiffs from enforcing Ecuador's ruling in a US court, and said his decision bars Donziger and some allies in the case "from profiting in any way from the egregious fraud that occurred here".

'Other jurisdictions'

Lago Agrio plaintiffs plan to press on with litigation against Chevron in Argentina, Brazil, Canada and possibly other jurisdictions.

"Nothing in Judge Kaplan's ruling will prevent my clients from pursuing the judgement's enforcement in other countries. The villagers deserve justice, and I am confident they will get it despite Chevron's efforts to undermine the rule of law," Donziger said.

Han Shan, a spokesman for Ecuadorian villagers, said they would continue to press to enforce the Ecuadorian ruling in other countries where Chevron does business. Chevron has no significant assets in Ecuador.