The Obama administration’s existing attempts to curb greenhouse gas emissions from power plants escaped largely unscathed from a U.S. Supreme Court ruling on Monday.

The justices had set out to decide whether the Environmental Protection Agency has the authority regulate emissions spewed by large stationary facilities like coal plants, chemical factories, steel mills and fertilizer manufacturers. In a 5-4 ruling in Washington, D.C., the court found that it mostly does.

“EPA is getting almost everything it wanted in this case,” Justice Antonin Scalia said from the bench. “It sought to regulate sources it said were responsible for 86 percent of all the greenhouse gases emitted from stationary sources nationwide. Under our holdings, EPA will be able to regulate sources responsible for 83 percent of those emissions.”

The decision upheld the agency’s authority to regulate existing facilities, and it did not appear to affect the EPA’s latest proposal to curb emissions from power plants in particular. If approved, those rules would require states to reduce emissions by 30 percent by 2030.

"Today is a good day for all supporters of clean air and public health," the EPA said in a release, adding that the court's decision "is a win for our efforts to reduce carbon pollution."

However, the justices did restrict the EPA’s ability to regulate emissions from new or modified facilities that are expected to be heavy polluters.

The decision traces back to a 2007 Supreme Court case, Massachusetts v. Environmental Protection Agency, which enabled the EPA to regulate carbon dioxide and other gases linked to global warming via the Clean Air Act. The federal law previously only included other harmful air pollutants like carbon monoxide, particulate matter and lead.

Under the clean air law, the EPA can require facility operators to obtain special permits if their plants are expected to cross a certain threshold of harmful pollution — usually 100 or 250 tons per pollutant annually. The idea is to encourage operators to reduce emissions to avoid a lengthy permitting process. But the 2007 court ruling created a problem: Greenhouse gases are emitted in far greater amounts than conventional air pollutants, and so the threshold of 100-250 tons encompasses millions of facilities, the New York Times reported.

To avoid burdening so many facilities with permits, the EPA decided simply to increase the established threshold for one pollutant, carbon dioxide, to 75,000 to 100,000 tons per year. Otherwise, applying the law as written would have raised the number of covered sources from 280 facilities to 80,000 under one permitting program, and to 6 million sources under a second program — an “absurd result,” the EPA said, according to the Times.

But regulators never sought congressional approval to make the change. And even though the new thresholds exempt many businesses from regulation, opponents of the rules pounced on the EPA's legally questionable move. The Supreme Court agreed that EPA had wrongly stretched the Clean Air Act program for new and expanded stationary sources.

USA Today called the ruling "a moral but somewhat hollow victory" for the industry and state government-led opposition, which has complained that the rules could cost billions of dollars to implement.

EPA said that state and federal regulators had issued 166 permits from since 2011 to March this year, the Associated Press noted.