In a case with major environmental and economic implications, the US Supreme Court ruled on Monday that the Environmental Protection Agency exceeded its authority when it sought to substantially expand its ability to control emissions of greenhouse gases across America.

In a 5-to-4 decision, the high court moved to sharply restrict the EPA’s broad conception of its own power to address the environmental threat of global warming.

“Were we to recognize the authority claimed by EPA …, we would deal a severe blow to the Constitution’s separation of powers,” Justice Antonin Scalia wrote for the majority justices.

But in an important compromise, the high court also ruled 7 to 2 to uphold a different section of the EPA’s regulatory regime to reduce greenhouse gas emissions. The 7-to-2 portion of the decision allows the EPA to press forward with greenhouse gas regulations covering 83 percent of stationary sources of such emissions from power plants, factories, and refineries.

The compromise allowed nearly everyone following the closely watched case a chance to claim some version of victory.

“The EPA’s foundational authority under the Clean Air Act to protect Americans’ health from the clear and present danger of climate pollution is rock solid,” Vickie Patton, general counsel at the Environmental Defense Fund, said in a statement.

“The Supreme Court gave a stinging and devastating rebuke to EPA’s grand design of regulating the entire American economy on the basis of greenhouse gases,” said Richard Faulk, senior director of Energy and Environmental Initiatives at George Mason Law School’s Law and Economics Center.

The Supreme Court decision is significant because it seeks to establish meaningful limits to the scope of the EPA’s authority to regulate greenhouse gases. It is also significant because it allows the agency to continue its efforts to grapple with the issue of global warming.

In reaching its decision, the high court embraced arguments by industry groups and certain states that the EPA was usurping legislative authority reserved to Congress by effectively rewriting the Clean Air Act to expand its coverage from toxic pollutants disbursed in the air to nontoxic greenhouse gases.

Regulation of greenhouse gases such as carbon dioxide are based not on the traditional concept of a pollutant posing a toxic threat to human health. Instead, the perceived threat from greenhouse gases is that global warming will alter Earth’s environment and cause more violent storms, changing weather patterns, and rising sea levels that threaten human safety.

A central issue in the case was whether the EPA had discretion to disregard numerical limits set by Congress in the Clean Air Act that were based on conventional toxic pollutants. The limits were designed to focus EPA authority on only the largest polluters.

Because greenhouse gases such as carbon dioxide are emitted in substantially larger volumes than are traditional toxic pollutants, agency officials recognized that applying the statutory limits to greenhouse gas emitters would require the EPA to reach far beyond the major polluters targeted in the Clean Air Act to significantly smaller businesses.

Instead of following 100-ton and 250-ton limits, agency officials wrote a new threshold of 100,000 tons for greenhouse gases.

It was this disregard – and rewriting – of the statute that drew the ire of the conservative wing of the court.

“Under our system of government, Congress makes laws and the President, acting at times through agencies like EPA, faithfully executes them,” Justice Scalia said. “We reaffirm the core administrative-law principle that an agency may not rewrite clear statutory terms to suit its own sense of how the statute should operate.”

He noted that under the agency’s rule, “EPA asserts newfound authority to regulate millions of small sources – including retail stores, offices, apartment buildings, shopping centers, schools, and churches – and to decide, on an ongoing basis and without regard for the thresholds prescribed by Congress, how many of those sources to regulate.”

“We are not willing to stand on the dock and wave goodbye as EPA embarks on this multiyear voyage of discovery,” Scalia said.

Even in the portion of the opinion dealing with the 7-to-2 compromise, Scalia’s tone was one of distrust of the EPA.

Under the approved provision, EPA is able to continue to regulate those with existing pollution permits under the Clean Air Act and to require them to limit greenhouse gas emissions by employing the “best available control technology (BACT)” at the time of any modification or new construction.

“Applying BACT to greenhouse gases is not so disastrously unworkable, and need not result in such a dramatic expansion of agency authority, as to convince us that EPA’s interpretation is unreasonable,” Scalia wrote.

But he also warned the agency against reading too much into the ruling.

“Our decision should not be taken as an endorsement of all aspects of EPA’s current approach, nor as a free rein for any future regulatory application of BACT in this distinct context,” he said.

Joining Scalia in the 5-to-4 majority were Chief Justice John Roberts, and Justices Anthony Kennedy, Clarence Thomas, and Samuel Alito.

Justice Stephen Breyer wrote a dissent to that section of the opinion, arguing that the court should permit the EPA enough regulatory flexibility to tackle greenhouse gas emissions in the way it prefers.

Joining Justice Breyer’s dissent were Justices Ruth Bader Ginsburg, Sonia Sotomayor, and Elena Kagan.

Those four justices joined Justices Scalia and Kennedy and Chief Justice Roberts to form the seven-justice majority that upheld EPA’s authority to regulate existing permit holders.

Justices Alito and Thomas were the two dissenters. They said the Clean Air Act applies only to conventional pollutants and does not authorize the EPA to regulate greenhouse gases.

Monday’s high court action drew a range of reactions. Many of them related to environmental regulation; others focused on the limits of regulatory power.

“Today, the Supreme Court repudiated the Obama administration’s effort to unilaterally rewrite the law in order to implement his radical job-killing agenda,” Sen. Orrin Hatch (R) of Utah said in a statement. “I applaud the Court’s willingness to stand up to President Obama’s brazen overreach.”

Howard Fox of Earthjustice said the decision marks the third consecutive ruling from the high court upholding EPA authority to regulate greenhouse gases.

“The decision keeps the architecture in place for setting national standards to limit carbon emissions from power plants, motor vehicles, and other sources,” he said.

US Chamber of Commerce CEO Thomas Donohue said the decision is a step toward reining in the EPA’s misuse of the Clean Air Act to regulate greenhouse gases.

“The Court recognized that EPA’s attempt to sweep small businesses into its greenhouse gas agenda was an unconstitutional power grab,” he said in a statement. “EPA is now on notice that it does not have unlimited authority to impose massive costs on the US economy and mandate a fundamental redesign of America’s electricity system.”

The case was Utility Air Regulatory Group v. Environmental Protection Agency (12-1146). It was among six cases consolidated for high court review.