BISMARCK, N.D. — A federal appeals court has upheld attorneys' fees awarded to North Dakota in lengthy legal battle over a Minnesota law aimed at promoting the use of renewable energy.

The 8th U.S. Circuit Court of Appeals on Tuesday affirmed a federal judge's order awarding North Dakota more than $1.3 million in attorneys' fees and other costs.

At issue was Minnesota's 2007 law that bars utilities from buying power from new plants that produce carbon dioxide emissions.

North Dakota's six coal-fired power plants export most their electricity to other states, including Minnesota.

North Dakota Attorney General Wayne Stenehjem sued Minnesota in 2011, saying the law hurt his state's ability to sell electricity and build new coal plants.

A federal judge ruled in 2014 that the Minnesota law illegally regulates out-of-state utilities.