A court in California, in a lawsuit that has dragged on for 13 years, ordered three companies on Monday to pay $1.1 billion to fund a painstaking process of removing lead-based paint from the interiors of thousands of homes in the state.

Judge James Kleinberg of Santa Clara County Superior Court handed a victory to 10 Californian cities and counties that sued former and current paint companies for promoting the sale of hazardous lead-based paints for decades, before it was banned in 1978. Lead, a powerful poison is known to cause severe health problems in people, especially in children.

In a tentative ruling the judge ordered three corporations -- Sherwin-Williams (NYSE:SHW), ConAgra (NYSE: CAG) and NL Industries (NYSE:NL) -- to deposit $1.1 billion in a state-administered fund, which will be used for inspections, and the removal or reduction of lead-based paint on the inside walls of homes in the state. The court dismissed cases against two other defendants, DuPont Co. and Atlantic-Richfield Co., owned by BP Plc (NYSE:BP), Los Angeles Times reported.

“The court is convinced there are thousands of California children in the Jurisdictions whose lives can be improved, if not saved through a lead abatement plan,” the judge’s ruling said.

Local governments had argued that the paint and pigment companies -- including both makers and distributors -- sold and promoted lead-based paints despite knowing that it exposed children to lead poisoning. However, the companies argued that they sold the product at a time when the ill effects of the product were not known, and such paints were not banned in the U.S.

Bonnie J. Campbell, a spokeswoman for the three defendants in the case, said the companies would appeal the court’s decision unless the judge ordered a fresh trial or declared a mistrial.

“The decision violates the federal and state constitutions by penalizing manufacturers for the truthful advertising of lawful products, done at a time when government officials routinely specified those products for use in residential buildings." Campbell said. “No public health official recommended any restriction on that use, because the risks to children alleged today were unknown and unknowable decades ago."

Meanwhile, ConAgra Company said, in a statement, that it disagrees with the ruling and added that the company should not have been part of the lawsuit.

“ConAgra Foods is absolutely not an appropriate defendant and was never in the paint business. As a food maker who employs thousands of people in California, we believe this case is an unfortunate example of extreme overreach,” the company said, in a statement.

ConAgra Foods became a defendant in the case because the company is an alleged successor to W. P. Fuller Co., a lead paint and pigment manufacturer that was owned and operated by the Beatrice Company until 1967, according to ConAgra's quarterly financial statement filed in Aug. 2013. Beatrice was acquired by ConAgra Foods in June 1990 for $1.34 billion.

Lead poisoning can result in kidney damage and hearing problems among other issues, while in children, it can lead to slower body growth, and behavioral and attention disorders.

About five million homes in the state's cities and counties that are covered under the judgment were built before the 1978 ban on lead paint, and could require decontamination. Many of these houses are in low-income neighborhoods and remain unrepaired and continue to harbor lead-paint flakes, endangering children living in these houses.

"It's a tremendous victory for the children, who have been living with the threat of lead paint for decades," Danny Chou, assistant Santa Clara County counsel said, according to San Jose Mercury News. "This provides a means to remove the source, and that's the only way to prevent kids from getting poisoned in the future."

Los Angeles County will benefit most from the proposed fund, with the court setting aside 55 percent of the $1.1 billion compensation for the county, while Santa Clara and Alameda counties would get $99 million each and San Mateo County would get $55 million. Other counties that sued the companies include San Francisco, San Diego, Monterey, Solano and Ventura counties.