The Supreme Court on Monday mostly validated the Environmental Protection Agency’s plans to regulate major sources of greenhouse-gas emissions such as power plants and factories but said the agency had gone too far in interpreting its power.

The court’s bifurcated opinion on one hand criticized the agency for trying to rewrite provisions of the Clean Air Act. But it nevertheless granted the Obama administration and environmentalists a big victory by agreeing that there are other ways for the EPA to reach its goal of regulating the gases that contribute to global warming.

“It bears mention that EPA is getting almost everything it wanted in this case,” Justice Antonin Scalia said in announcing his opinion from the bench. “It sought to regulate sources that 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 concerns rules separate from the more comprehensive plan the EPA proposed this month to cut carbon emissions from existing plants by as much as 30 percent over 15 years. And the ruling follows another decision this term that upheld the EPA’s authority to regulate air pollution that drifts across state borders, one of the administration’s top environmental goals.

“Today is a good day for all supporters of clean air and public health and those concerned with creating a better environment for future generations,” the EPA said in a statement.

Environmentalists focused on the practical impact of the decision. And Sean H. Donahue, who represented environmental agencies in the case, welcomed an affirmation from seven of the nine justices that the Clean Air Act gives the agency the authority to act on greenhouse gases.

“It’s settled law,” he said.

Industry opponents of the Obama administration’s aggressive use of executive power to push new regulations said they are encouraged by warnings in the opinion that the EPA’s power is limited.

Laura Sheehan, senior vice president for communications of the coal-industry-backed American Coalition for Clean Coal Electricity, said she is “hopeful EPA’s massive mission creep will be subject to the scrutiny it deserves and stricken down by the judiciary in the future.”

Scalia’s opinion, which was joined in full only by Chief Justice John G. Roberts Jr. and Justice Anthony M. Kennedy, gave both sides something to like.

What made the case complex is that even the EPA acknowledged that certain provisions in the Clean Air Act do not easily lend themselves to regulating greenhouse gases such as carbon dioxide, which is ubiquitous in the environment.

Although the law said emissions of certain pollutants of 100 to 250 tons per year triggered permitting requirements, the EPA had to raise those to 75,000 to 100,000 tons per year for greenhouse gases to identify the facilities most in need of regulation.

But Scalia wrote that agencies are not free to “revise clear statutory terms that turn out not to work in practice.”

He also said that emissions of greenhouse gases alone are not enough to trigger EPA enforcement — that would sweep in too many small sources, such as schools, churches and shopping centers.

Scalia, Roberts and Kennedy were joined in that part of the opinion by fellow conservatives Clarence Thomas and Samuel A. Alito Jr.

Justice Stephen G. Breyer said in rebuttal that the EPA was simply exercising its discretion to further the interest of Congress and the public “in more effective, less wasteful regulation.” Fellow liberals Ruth Bader Ginsburg, Sonia Sotomayor and Elena Kagan agreed with him.

But although the first 24 pages of Scalia’s opinion criticized the agency, he came to its rescue — grudgingly, by its wording — in the final four pages.

He said that the agency could require that sources already having to comply with mitigating the effects of other pollutants could be required to do the same for greenhouse gases.

That would be “not so disastrously unworkable,” he wrote, and would not extend the EPA’s authority over “millions of previously unregulated entities.”

That compromise was supported by Breyer, Ginsburg, Sotomayor and Kagan. It was a suggestion Roberts raised at oral arguments in the case, and Solicitor General Donald B. Verrilli Jr. agreed that it would allow the agency to cover all but 3 percent of the sources it wanted to regulate.

Only Thomas and Alito voted against the administration across the board.

Among the greenhouse gas producers that might not be regulated, according to the EPA, are municipal or commercial landfills that are large, but not large enough to be covered by other EPA regulations; pulp and paper facilities; electronics manufacturing plants; some chemical production plants; and beverage producers.

The EPA was challenged by industry groups, the U.S. Chamber of Commerce and a number of states, led by Texas.

The legal battle in part resulted from the inability of the administration and Congress to find common ground on the issue of global warming.

The court ruled in the 2007 case Massachusetts v. EPA that carbon dioxide and other greenhouse gases are pollutants that can be regulated under the Clean Air Act. That case, which was brought by states that said the EPA under President George W. Bush was not doing enough to fight global warming, concerned regulating motor vehicles.

The Obama administration later reasoned that “stationary sources” — factories, power plants and other structures — were also subject to the permitting requirements in certain parts of the act.

A unanimous panel of the U.S. Court of Appeals for the District of Columbia Circuit agreed with that view. It said that court precedents made the agency’s readings of its powers “unambiguously correct.”

Although environmentalists were happy with Monday’s ruling, they said the decision on cross-state pollution earlier in the term was a bigger victory for the administration.

The EPA for years, under two administrations, had struggled to carry out a directive under the Clean Air Act to protect downwind states from pollution generated in other states, mostly from coal-fired power plants. The EPA’s rules from 2011 were challenged by a coalition of upwind states and industry, which prevailed in lower courts.

But the Supreme Court ruled 6 to 2 that the latest effort could be implemented, with Ginsburg writing for the majority that the agency must have leeway to confront the “complex challenge” of interstate pollution.

Monday’s decision consolidated six cases filed against the administration. The lead case was Utility Air Regulatory Group v. EPA.

Steven Mufson contributed to this report.