A California judge has ruled that Starbucks must add cancer warning labels to its coffee cups.

A lawsuit filed in 2010 accused coffee companies of violating state law by not warning consumers that a chemical in their products could cause cancer.

The National Coffee Association has indicated the companies are considering appealing the case.

Starbucks drinkers in California can expect to see cancer warning labels on their coffee cups in the future.

On Wednesday, a Los Angeles judge ruled in favor of a nonprofit that sued 90 coffee companies over claims that they had failed to comply with a state law that requires businesses to warn consumers about chemicals in their products that could cause cancer, Reuters reported.

The lawsuit, filed in 2010 by the Council for Education and Research on Toxics, pointed to a chemical called acrylamide that exists in brewed coffee.

Studies have previously found that in large quantities, acrylamide can increase the risk of cancer in some animals. It's among the chemicals California lists as "known to cause cancer."

When reached for comment, Starbucks referred Business Insider to a statement from the National Coffee Association on Thursday:

"The industry is currently considering all of its options, including potential appeals and further legal actions. Cancer warning labels on coffee would be misleading. The US government's own Dietary Guidelines state that coffee can be part of a healthy lifestyle. The World Health Organization (WHO) has said that coffee does not cause cancer. Study after study has provided evidence of the health benefits of drinking coffee, including longevity — coffee drinkers live longer."

According to Reuters, some of the other defendants had already agreed to put warnings on their products and pay millions of dollars in fines before Wednesday's decision. Other companies — including Starbucks, McDonald's, and Dunkin' Donuts — have until April 10 to file appeals.

"Coffee has been shown, over and over again, to be a healthy beverage," Bill Murray, the CEO of the National Coffee Association, said in a statement on Thursday. "This lawsuit has made a mockery of Prop 65, has confused consumers, and does nothing to improve public health."