An Ecuadorian judge has ruled that Chevron was responsible for widespread contamination of the country's Amazon basin and fined the company $8bn (£5bn). The oil firm blasted the ruling as a "fraud".

Pablo Fajardo, the plaintiffs' lawyer, told Associated Press the judgement at the provincial court of justice of Sucumbíos in Lago Agrio was "a great step that we have made towards the crystallisation of justice", but the fine was too small – far below the $27.3bn sought by the plaintiffs – and they may appeal.

The epic and bitterly fought lawsuit over the "Amazon Chernobyl" has been going on for 18 years. It was brought on behalf of 30,000 people whose health and environment were allegedly damaged by chemical-laden waste water dumped by Texaco's operations from 1972 to 1990. Chevron bought Texaco in 2001.

The lawsuit alleges that Chevron should be held responsible for $27bn in damages from illness, deaths and economic loss suffered by the Amazon residents. The case was the subject of 2009's award-winning documentary Crude and has attracted celebrity supporters including Sting, Trudie Styler and Daryl Hannah.

The case goes back to the 1970s when Texaco partnered the government oil company PetroEcuador to drill wells. Texaco ended its Ecuadorian operations in the 1990s and was assigned responsibility for cleaning up sites proportional to its share in the project. The company spent $40m on the clean-up and argues that it was legally released from further claims or liabilities. But the suit claims the clean-up failed to address faulty drilling practices by Texaco that caused damage to wide areas of jungle and harmed indigenous people.

The case has triggered a slew of related legal action in the US and international courts and has led to an arbitration case in The Hague. This month Chevron lawyers sued a group of trial lawyers and consultants, claiming they were organising a campaign to rig the Ecuadorian court system in a bid to win billions in the pollution claim.

Last week an international arbitration panel in The Hague ordered Ecuador to "take all measures at its disposal to suspend or cause to be suspended the enforcement or recognition within and without Ecuador of any judgment" against Chevron in the case. Chevron had claimed that Ecuador was violating the terms of a 1997 trade pact with the US.

A 2009 US state department report entitled Investment Climate Statement for Ecuador stated: "Systemic weakness and susceptibility to political or economic pressures in the rule of law constitute the most important problem faced by US companies investing in or trading with Ecuador." The report claimed "corruption is a serious problem in Ecuador," and that "the courts are often susceptible to outside pressure and bribes".

Chevron said the judgment was "illegitimate and unenforceable", adding: "It is the product of fraud and is contrary to the legitimate scientific evidence. Chevron will appeal against this decision in Ecuador and intends to see that justice prevails.

"United States and international tribunals already have taken steps to bar enforcement of the Ecuadorian ruling. Chevron does not believe that today's judgment is enforceable in any court that observes the rule of law. Chevron intends to see that the perpetrators of this fraud are held accountable for their misconduct."

In contrast, the advocacy groups Amazon Watch and Rainforest Action Network hailed the ruling. "It is time Chevron cleans up its disastrous mess in Ecuador."

On the possibility of appealing, Fajardo said: "We believe the evidence before the court deserves international respect and the plaintiffs will take whatever actions are appropriate consistent with the law to press the claims to a final conclusion."

Judge Nicolas Zambrano, who made the ruling from the provincial town of Lago Agrio, gave Chevron 60 days to set up an escrow account in Ecuador through which the damages would be distributed. Analysts said appeals meant the case probably had years to run but that the oil industry had been dealt a warning to clean up its act.

According to a report by Sweden's Umeå International School of Public Health more than 30bn gallons of toxic wastes and crude oil had been discharged into the land and waterways of Ecuador's Amazon basin - or "Oriente". This compares to the 10.8m gallons spilled in the Exxon Valdez disaster in 1989 in Alaska or 205m gallons spilt in BP's Deepwater Horizon disaster. The report claims there are at least two big oil spills per week in the area.