Despite its long list of health benefits, coffee in California will soon come with a consumer warning about cancer.

A judge in March ruled in favor of the Council for Education and Research on Toxics, which in 2010 first filed a lawsuit that sought to require coffee sellers, including Starbucks, BP, Gloria Jean’s and 7-Eleven, to warn customers about the ingestion of acrylamide, a possibly cancer-causing chemical that’s produced when coffee beans are roasted.

Under California’s Proposition 65, businesses are required to notify customers if their products contain any of 65 chemicals, including acrylamide, that are linked with cancer, birth defects or other reproductive issues. In failing to post carcinogen warnings, the lawsuit alleged, the coffee shops are in violation of this policy.

Before the judge’s ruling, 13 defendants, including 7-Eleven, settled and agreed to post warnings, CNN reports.

The warning, as set forth by the lawsuit, reads, “Chemicals known to the State of California to cause cancer and reproductive toxicity, including acrylamide, are present in coffee, baked goods, and other food or beverages sold here. Acrylamide is not added to our products, but results from cooking, such as when coffee beans are roasted or baked goods are baked. As a result, acrylamide is present in our brewed coffee….”

Coffee retailers fought against the suit, arguing that the levels of acrylamide present in the beverage are not harmful, and that the health benefits of java outweigh its risks, CNN reports. National Coffee Association CEO Bill Murray told CNN in a statement: “Coffee has been shown, over and over again, to be a healthy beverage. The US Government’s own Dietary Guidelines state that coffee can be part of a healthy lifestyle. This lawsuit simply confuses consumers, and has the potential to make a mockery of Prop 65 cancer warning at a time when the public needs clear and accurate information about health.”

The Food and Drug Administration (FDA) agrees. Commissioner Scott Gottlieb said in an August statement that putting a cancer warning on coffee is “more likely to mislead consumers than to inform them,” since the connection between coffee and cancer is not well-established, but plenty of research supports probable health benefits from drinking coffee. Gottlieb said in the statement that the FDA supports a proposed Proposition 65 exemption for coffee sellers.

As Gottlieb suggests, research has shown that coffee contains cancer-fighting antioxidants and may reduce the risk of developing type 2 diabetes and heart disease. It may even help people live longer and age better, according to recent research. However, in 2016, the International Agency for Research on Cancer (IARC), which is part of the World Health Organization, concluded that drinking very hot beverages may increase the risk of esophageal cancer. The IARC said that there isn’t enough evidence to classify coffee as a carcinogen, but the temperature at which it’s consumed matters.

Acrylamide, which forms when sugars and amino acids are cooked at temperatures above 150 degrees, is not limited to coffee. The chemical is also found in fried foods, such as french fries and potato chips, as well as baby food and baked goods.

In 2007, fast food restaurants in California began posting warnings about acrylamide.

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Jamie Ducharme at jamie.ducharme@time.com.