A California judge ruled that Starbucks and other coffee sellers in the state will be required to warn customers that their coffees carry a cancer risk, according to The Associated Press.
In his decision, Superior Court Judge Elihu Berle said the companies failed to comply with a state law that requires businesses to warn customers about chemicals that could have negative health effects.
At issue is acrylamide, a chemical that is produced while roasting coffee beans. It is classified as a weak carcinogen.
Berle said the companies had failed to prove those chemicals are harmless, according to the AP.
The ruling comes after years of litigation. A nonprofit research group sued coffee roasters claiming they violated the law by not warning consumers about the chemical.
Many companies, including 7-Eleven, have already consented to post the warnings in settlements over the lawsuit.
The National Coffee Association, though, has questioned claims that acrylamide is toxic and maintains that coffee is a healthy beverage.