An international tribunal in The Hague has ruled in favour of the US oil company, Chevron, in an environmental dispute with the government of Ecuador.
Chevron had been ordered to pay $9.5bn (£7.4bn) compensation to thousands of residents in Ecuador's Amazon region.
They accused the company of dumping toxic waste in local lakes and rivers of the Lago Agrio region for decades.
The court said that the 2011 Ecuador Supreme Court ruling had been obtained through fraud, bribery and corruption.
The oil giant now stands to be awarded hundreds of millions of dollars in costs by The Hague's Permanent Court of Arbitration.
Chevron maintained that it never owned any assets in Ecuador.
The alleged environmental damage was done by Texaco between 1964 and 1992. Texaco was later acquired by Chevron.
Chevron has argued that Texaco spent $40m ($31m) cleaning up the area during the 1990s, and signed an agreement with Ecuador in 1998 absolving it of any further responsibility.
Some 30,000 local residents, including five different Amazonian tribes, began the lawsuit against Texaco in 1993.
The plaintiffs say that the oil company knowingly dumped 18bn gallons (68bn litres) of toxic waste water and spilled 17m gallons of crude oil into the rainforest during its operations in north-east Ecuador.
They say the affected area covers 4,400 sq km (1,700 sq miles) on the border with Colombia.
Local residents believe the pollution has led to health problems such as cancer and birth defects.
In 2011, an Ecuadorean judge ordered Chevron to pay $18.2bn (£14.1bn) for "extensively polluting" the Lago Agrio region.
Ecuador's highest court last year upheld the verdict against Chevron a year later, but reduced the amount of compensation to $9.5bn.
Chevron argued that it only lost the case because the legal team representing the villagers paid nearly $300,000 (£232,000) in bribes in Ecuador.
In 2014, US district judge Lewis Kaplan in New York ruled that "corrupt means" were used by Ecuador's legal team to win the 2011 case.
After the latest ruling in the Hague, a lawyer for the indigenous communities criticised the Ecuadorean government for accepting taking the case to an arbitration court.
"That is playing Chevron's game and leaving the crime unpunished forever," said Pablo Fajardo.
He said he was considering all legal avenues.