WASHINGTON — A divided Supreme Court on Monday ruled against federal regulators’ attempt to limit power plant emissions of mercury and other hazardous air pollutants.

The rules began to take effect in April, but the court split 5-4 along ideological lines to rule that the Environmental Protection Agency failed to take their cost into account when the agency first decided to regulate the toxic emissions from coal- and oil-fired plants.

The EPA did factor in costs at a later stage when it wrote standards that are expected to reduce the toxic emissions by 90 percent. They were supposed to be fully in place next year. The issue was whether health risks are the only consideration under the Clean Air Act.

The challenge was brought by industry groups and 21 Republican-led states.

Writing for the court, Justice Antonin Scalia said it is not appropriate to impose billions of dollars of economic costs in return for a few dollars in health or environmental benefits.

The case now goes back to lower courts for the EPA to decide how to account for costs.

Scalia was joined by Chief Justice John Roberts and Justices Anthony Kennedy, Clarence Thomas and Samuel Alito.

In dissent, Justice Elena Kagan said it was enough that the EPA considered costs at later stages of the process.

“Over more than a decade, EPA took costs into account at multiple stages and through multiple means as it set emissions limits for power plants,” Kagan said.

She was joined by Justices Ruth Bader Ginsburg, Stephen Breyer and Sonia Sotomayor.

The case is the latest in a string of attacks against the administration’s actions to use the Clean Air Act to rein in pollution from coal-burning power plants.

EPA is readying rules expected to be released sometime this summer aimed at curbing pollution from the plants that is linked to global warming. States have already challenged those rules even before they are final, and Congress is working on a bill that would allow states to opt out of any rules clamping down on heat-trapping carbon dioxide.

The legal and political challenges ahead could undermine U.S. efforts to inspire other countries to control their emissions, as they head into negotiations in Paris on a new international treaty later this year.

In the case of mercury, the costs of installing and operating equipment to remove the pollutants before they are dispersed into the air are hefty — $9.6 billion a year, the EPA found.

But the benefits are much greater, $37 billion to $90 billion annually, the agency said. The savings stem from the prevention of up to 11,000 deaths, 4,700 nonfatal heart attacks and 540,000 lost days of work, the EPA said. Mercury accumulates in fish and is especially dangerous to pregnant or breastfeeding women, and young children, because of concern that too much could harm a developing brain.

A disproportionate share of the 600 affected power plants, most of which burn coal, are in the South and upper Midwest.

Associated Press writer Sam Hananel wrote this report.