Tobacco companies, led by Philip Morris International, lost an appeal in the European Union’s top court Wednesday against strict packaging rules for cigarettes. The Court of Justice for the European Union also dismissed appeals by Poland and Romania to the EU decision to ban flavored cigarettes, such as menthol.

In the matter of flavored cigarettes, the court reasoned that tobacco products with menthol or another “pleasant flavor” makes them “more attractive to consumers and that reducing the attractiveness of those products may contribute to reducing the prevalence of tobacco use and dependence among new and continuing users.”

In a statement on the official EU website, the court also said that the EU legislature was right in forming the law in 2014, which guards against divergences in different rules of various member states, especially when it came to health matters.

In a setback to tobacco companies, led by Philip Morris and British American Tobacco, the court also ruled in favor of EU regulations on cigarette packaging, which mandate a message and a color photograph — covering at least 65 percent of each packet’s front and back — warning of the dangers of smoking. The court said that “the EU legislature did not go beyond the limits of what is appropriate and necessary,” and added that individual countries could impose stricter rules, such as plain packaging without any branding.

The court also upheld new limits on e-cigarettes, despite manufacturers claiming they should be dealt with under a different law because e-cigarettes were not actually tobacco products. A limit on maximum nicotine content, of 20 mg/ml, was declared valid, along with requirements of specific warnings and leaflets, and a prohibition on advertising.

“The identified and potential risks linked to the use of electronic cigarettes have led the EU legislature to act in a manner consistent with the requirements stemming from the precautionary principle,” the court said.

The ruling by the Court of Justice for the European Union cannot be appealed.