But the battle is not over. Mark Dayton, Minnesota’s Democratic governor, quickly announced plans to appeal the Eighth U.S. Circuit Court of Appeals ruling.

In 2011, North Dakota Attorney General Wayne Stenehjem sued Minnesota, claiming the law violated the Commerce Clause of the U.S. Constitution by restricting transmission of electricity generated in North Dakota and consumed in Minnesota unless it met the state’s carbon dioxide emission requirements.

Critics of the law argued it effectively would have prevented North Dakota electric utilities from selling power into the Midcontinent Independent System Operator (MISO) market. MISO, based in Carmel, Indiana, is a regional grid operator operating in 15 states.

In its decision, the appeals court observed that “electrons flow freely without regard to state borders, entirely under MISO’s control” and that a person who “imports” electricity “does not know the origin of the electrons it receives, whether or not the transaction is pursuant to a long-term purchase agreement with an out-of-state generator.”

Stenehjem praised the ruling, saying the law would have hurt businesses and electricity customers in North Dakota and Minnesota.

Jason Bohrer, president and CEO of the North Dakota Lignite Council, thanked Stenehjem for his “outstanding leadership that has led to two legal victories against Minnesota’s NextGen Act of 2007.” A federal judge in 2014 also ruled in favor of North Dakota in its longstanding legal dispute with Minnesota. The Lignite Council, a regional trade association, and several of its members were party to the lawsuit originally filed in 2011.

“Our two states, North Dakota and Minnesota, have an energy partnership that goes back several decades,” Bohrer added. “North Dakota produces affordable and reliable electricity from our state’s coal mines. Much of our electricity is exported with a majority flowing to Minnesota customers.”

Bohrer said he hoped the legal victory “can be set aside and our two states can work together in the future on mutually beneficial energy solutions.”

But that does not appear to be Minnesota’s intent. Dayton said in a statement that after consulting with Minnesota Attorney General Lori Swanson, he decided to appeal the appeals court’s decision.

“The state statute does not prevent anyone from building and operating a new power generating facility,” he said. “It only requires that those new emissions must be offset by the same or greater reduction in emissions from existing plants. Minnesota’s law encourages the replacement of older, more-polluting power plants with more efficient, cleaner facilities.”