Updated at 1:45 p.m. ET

The Supreme court has ruled against an Obama administration effort to limit toxic mercury emissions from power plants, saying the costs of compliance should be taken into account at the very earliest stages of the regulatory process.

In a 5-4 decision, the court sided with industry and 23 states that challenged the Environmental Protection Agency over the rules for oil- and coal-fired utilities, which the EPA estimated would cost $9.6 billion annually. The states and industry groups said the cost estimate far outweighed the benefits the rules would produce, estimated at $4 million to $6 million per year.

The court's majority agreed, saying the EPA interpreted the regulation "unreasonably when it deemed cost irrelevant to the decision to regulate power plants."

NPR's Nina Totenberg has this background on the case, Michigan v. Environmental Protection Agency:

"The regulations have been in the works for nearly two decades. Work on them began in the Clinton administration, got derailed in the George W. Bush administration, and then were revived and adopted in the Obama administration."The regulations were subsequently upheld by a federal appeals court in Washington, D.C., last year."They stem from 1990 amendments to the Clean Air Act, which ordered the Environmental Protection Agency to expedite limits on power plant emissions of mercury and 188 other dangerous air pollutants."Mercury is considered one of the most toxic pollutants because studies show that when it falls from the atmosphere, it readily passes from fish and other sources to a pregnant woman's unborn fetus and the fetal brain, causing neurological abnormalities and delays in children. The EPA estimated that 7 percent of American women of childbearing age — millions of women — were being exposed to the pollutant in dangerous amounts."

In his majority opinion, Justice Antonin Scalia writes that "it is unreasonable to read an instruction to an administrative agency to determine whether 'regulation is appropriate and necessary' as an invitation to ignore cost."

In her dissent, however, Justice Elena Kagan says the EPA did indeed take cost into consideration at a later stage:

"Costs matter in regulation. But when Congress does not say how to take costs into account, agencies have broad discretion to make that judgment...."The result is a decision that deprives the American public of the pollution control measures that the responsible Agency, acting well within its delegated authority, found would save many, many lives."

It's unclear what the practical effect of the court's ruling will be. The regulations date back to 2012, and as this case has been winding its way through the court system, many if not most of the affected power plant operators have installed the scrubbers and other controls needed to cut the mercury and other emissions.

John Walke of the Natural Resources Defense Council says the court's ruling "leaves the EPA rule in place, and we are confident the agency will meet its burden in justifying these important health standards, because the benefits to the American people overwhelmingly outweigh industry compliance costs."

Copyright 2016 NPR. To see more, visit http://www.npr.org/.