The Supreme Court has ruled in favor of technology competition and innovation in how energy customers are compensated for reducing their electricity consumption.

The Court’s decision, issued Monday, ruled in favor of maintaining a federal regulator’s authority over financial incentives that conserve energy use during peak periods like a hot summer day. Known in the industry as “demand response,” this system can manage the power grid more cost-effectively and in a more environmentally-friendly manner than paying power generators to produce more electricity.

About 15 years ago, companies like EnerNOC (fortune-stock symbol=”ENOC”] started building businesses in the newly created demand response market. Wholesale electricity market producers started working with companies like EnerNOC to reduce demand on the electrical grid, and not just add more supply.

In more recent years, startups like Google’s smart thermostat maker, Nest, and software company EcoFactor created gadgets for helping consumers participate in demand response programs.

Since 1935, as part the Federal Power Act, the Federal Energy Regulatory Commission has had the authority to regulate the demand response market. FERC manages the compensation related to demand response for the wholesale electricity markets, in which electricity is competitively bought and sold.

About five years ago, to help maintain competition for demand response, FERC ruled that companies that deliver demand response services should receive the same rates for conserving electricity as companies that generate electricity. Naturally, companies that make money off of producing electricity (and not conserving it) didn’t like that ruling. The Electric Power Supply Association, representing electric power producers, took FERC to court and challenged the order.

WATCH: The economics behind clean energy:

In 2014, a D.C. Circuit court sided with the power producers and found that states have exclusive jurisdiction over the demand response market, not the federal government. Last year, the Supreme Court agreed to take on the case and then heard oral arguments.

On Monday, the Supreme Court upheld FERC’s order that it can regulate demand response in wholesale markets and maintain the same rates for electricity that’s either produced or saved. Six judges sided with FERC, while two judges dissented (and one recused himself).

The news is cause for celebration for demand response providers of all kinds including EnerNOC and Nest. EnerNOC’s shares rose almost 70% on the deal to trade at close to $7 in mid-day trading. Tim Healy, chairman and CEO of EnerNOC, said in a statement: “Today’s decision is a tremendous win for all energy consumers, for the economy, and for the environment.”

The ruling is also important for the creation of more competition and tech innovation for the U.S. power grid. The power industry is a hybrid of regulated entities and competitive wholesale markets, and has been notoriously slow to adopt new technology.

The decision is also a win for energy efficiency and reducing carbon emissions by U.S. power producers. By compensating conservation at the same rates as coal power or dirty peaker power plants (which only turn on during peak grid times), the U.S. is maintaining the importance of energy efficiency as an important way to manage the grid.

The Natural Resources Defense Council wrote this morning: “The court’s welcome decision could save customers billions of dollars, move the ball forward in the fight against climate change, and remove barriers to the modernization necessary to achieve a clean, reliable and affordable grid.”