WASHINGTON (Reuters) - The U.S. Supreme Court on Monday upheld a major Obama administration electricity-markets regulation that encourages big power users like factories to cut consumption at peak times, rejecting a challenge brought by electric utilities.

The court, ruling 6-2, reversed a 2014 decision by the U.S. Court of Appeals for the District of Columbia Circuit to strike down the 2011 Federal Energy Regulatory Commission regulation.

The rule concerns what FERC calls “demand response,” which is when, in an attempt to manage electricity demand, regional electrical grid operators agree to pay large electricity users like factories, businesses, schools and hospitals to cut usage at peak times.

The court also upheld the formula the government adopted for compensating electricity users that receive the payments.

“Demand response” is intended to improve grid reliability, lower costs and encourage clean energy. It can cut costs for consumers and reduce the possibility of system failures and power blackouts.

“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,” White House spokesman Frank Benenati said.

Shares of EnerNOC Inc, a company that helps consumers lower electricity use that intervened in the case to support the rule, gained nearly 50 percent to $6.14 on the Nasdaq following the ruling.

Utility trade groups including the Electric Power Supply Association had challenged the regulation. Utilities are likely to lose out because the rule, which remained in effect during the court challenge, was likely to reduce demand for electricity generation.

Shares of utilities Dynegy Inc and Exelon Corp fell 7.6 percent and 1.9 percent respectively on the New York Stock Exchange.

FERC exercises authority over wholesale electricity markets, with retail markets traditionally overseen by states. The challengers argued FERC exceeded its authority by extending its power over retail markets.

Liberal Justice Elena Kagan, writing for the majority, said FERC’s focus was on the wholesale market, and the impact on retail rates did not erase its authority to act.

“The commission’s rule addresses - and addresses only - transactions occurring on the wholesale market,” Kagan wrote.

Kagan said “whatever the effects at the retail level, every aspect of the regulatory plan happens exclusively on the wholesale market and governs exclusively that market’s rules.”

Jody Freeman, director of Harvard Law School’s environmental law and policy program, called the ruling a “crucial step” toward the Obama administration’s goal to reduce carbon emissions that contribute to climate change.

Justice Samuel Alito did not participate in the case.