Drug manufacturers must pay to dispose of unused and unexpired medications in Alameda County, California, a federal appeals court ruled this week. The decision upheld a lower-court ruling.

Alameda County passed an ordinance in 2012 to establish a drug take-back program. The county said the measure is the first in the nation to require drug makers to set up a program to dispose of expired and unused medications. County officials said the annual cost of the program will be about $330,000, according to The Wall Street Journal. The industry trade group, Pharmaceutical Research and Manufacturers of America, estimates the program would cost drug makers about $1.2 million.

The county wants to reduce contaminants in drinking water by giving people an alternative to flushing their medications down the toilet. Officials also hope the measure will reduce prescription drug abuse by reducing the amount of medication in home medicine cabinets.

The pharmaceutical industry filed a lawsuit that claimed the measure violates the Constitution by interfering with interstate commerce, the article notes. The suit argued safe disposal of unused medications should be a shared responsibility, and that requiring drug companies to pay for the entire cost would ultimately result in increased prices for consumers.

The Ninth U.S. Circuit Court of Appeals in San Francisco ruled 3-0 that the ordinance treats all drug manufacturers equally and does not place a substantial burden on interstate business, according to the newspaper. The court noted drug companies generate $950 million in sales annually in the county, and could easily afford the cost of the program.