(Reuters) - Starbucks Corp SBUX.O and other coffee sellers must put a cancer warning on coffee sold in California, a Los Angeles judge has ruled, possibly exposing the companies to millions of dollars in fines.

A little-known not-for-profit group sued some 90 coffee retailers, including Starbucks, on grounds they were violating a California law requiring companies to warn consumers of chemicals in their products that could cause cancer.

One of those chemicals is acrylamide, a byproduct of roasting coffee beans that is present in high levels in brewed coffee.

Los Angeles Superior Court Judge Elihu Berle said in a decision dated Wednesday that Starbucks and other companies had failed to show there was no significant risk from a carcinogen produced in the coffee roasting process, court documents showed.

Starbucks and other defendants have until April 10 to file objections to the decision.

Starbucks declined to comment, referring reporters to a statement by the National Coffee Association (NCA) that said the industry was considering an appeal and further legal actions.

“Cancer warning labels on coffee would be misleading. The U.S. government’s own Dietary Guidelines state that coffee can be part of a healthy lifestyle,” the NCA statement said.

In his decision, Berle said: “Defendants failed to satisfy their burden of proving by a preponderance of evidence that consumption of coffee confers a benefit to human health.”

Officials from Dunkin’ Donuts DNKN.O, McDonald's Corp MCD.N, Peet's and other big coffee sellers did not immediately respond to requests for comment.

The lawsuit was filed in 2010 by the Council for Education and Research on Toxics (CERT). It calls for fines as large as $2,500 per person for every exposure to the chemical since 2002 at the defendants’ shops in California. Any civil penalties, which will be decided in a third phase of the trial, could be huge in California, which has a population of nearly 40 million.

CERT’s lawyer Raphael Metzger did not immediately respond to a request for comment.

Starbucks lost the first phase of the trial in which it failed to show the level of acrylamide in coffee was below that which would pose a significant risk of cancer. In the second phase of the trial, defendants failed to prove there was an acceptable “alternative” risk level for the carcinogen, court documents showed.

Several defendants in the case settled before Wednesday’s decision, agreeing to post signage about the cancer-linked chemical and pay millions in fines, according to published reports.