A worker clears snow on Jan. 24 behind a snowbank outside the Supreme Court. (Michael Reynolds/European Pressphoto Agency)

The Supreme Court delivered a big win Monday to the Obama administration and environmentalists, ruling that the Federal Energy Regulatory Commission has the authority to adopt a program that it says has saved money and prevented emergencies such as blackouts.

The approach, called demand response, requires operators of electricity markets to compensate customers who lower their consumption during peak demand hours.

FERC’s actions were challenged by electricity generators, who said that the commission could only regulate wholesale sales of electricity and that its program intruded on the retail market, which is the exclusive province of state regulators. The program has cost the electric companies profits.

The court ruled, 6 to 2, that FERC was within its powers.

“It is a fact of economic life that the wholesale and retail markets in electricity, as in every other known product, are not hermetically sealed from each other,” Justice Elena Kagan wrote for the majority. But she added, “The commission’s rule addresses — and addresses only — transactions occurring on the wholesale market.”

She said the court would not read the Federal Power Act so narrowly that it would “halt a practice that so evidently enables the commission to fulfill its statutory duties of holding down prices and enhancing reliability in the wholesale energy market.”

Kagan was joined by Chief Justice John G. Roberts Jr. and Justices Anthony M. Kennedy, Ruth Bader Ginsburg, Stephen G. Breyer and Sonia Sotomayor.

Justices Antonin Scalia and Clarence Thomas dissented. Justice Samuel A. Alito Jr. recused himself from the case, apparently because of a financial interest in one of the companies that is a party to the case.

The Obama administration, environmental groups and some large consumers say demand response is a key mechanism for getting people to use less energy overall and, thus, reducing emissions of carbon dioxide and other pollutants. Factories, big-box retailers and schools are among those that are paid for reducing their electrical use during peak times.

The White House praised the court’s decision.

“It is good news for consumers, clean energy, reliability, and the overall economy,” said White House spokesman Frank J. Benenati. “This decision allows us to continue realizing billions in annual savings from innovative incentives and business models that ensure we use our electricity system efficiently as we integrate more energy efficiency and renewable energy onto the power grid.”

Vicki Patton, general counsel for the Environmental Defense Fund, called the ruling a “victory for customer freedom, customer choice and the vibrant market for low-cost, clean energy.”

Demand for electricity varies greatly, and when it peaks — usually in the afternoon or evening each day, but also seasonally, such as on very hot days — power companies have to bring additional power plants online to service that peak load.

In doing so, the companies address the need for more electricity by adding more supply. But demand response can reduce how much power people or companies use during these peak times.

The administration claimed that the program was an example of federal-state cooperation that had saved billions of dollars in wholesale costs and was an effective tool in preventing blackouts and brownouts.

Scalia said the “demand response” scheme crosses over into regulating retail sales of electricity, which all agree is beyond the commission’s authority.

He said the majority adopted a “myopic view of retail pricing” in order to evade the “inconvenient fact that fiddling with the effective retail price of electric energy, be it through incentive payments or hypothetical credits, regulates retail sales of electric energy no less than does direct rate-setting.”

The case is Federal Energy Regulatory Commission v. Electric Power Supply Association.