LOS ANGELES — A Los Angeles judge has issued a final ruling requiring coffee to carry cancer warning labels in California.

Superior Court Judge Elihu Berle issued his decision Monday that Starbucks and other coffee companies failed to show that benefits from drinking coffee outweighed any risks.

The ruling mirrors Berle’s tentative decision issued in March that was expected to stand.

A nonprofit group sued coffee roasters, distributors and retailers under a state law requiring warnings on chemicals that can cause cancer. One is acrylamide, a carcinogen present in coffee.

The coffee industry had claimed the chemical was present at harmless levels and should be exempt from the law because it results naturally from the cooking process to make the beans flavorful. They also pointed to health benefits associated with the brew.