A Massachusetts law barring the state from doing business with companies that trade with Burma is unconstitutional, a federal appeals court has held.

The decision released Tuesday by the 1st U.S. Circuit Court of Appeals could affect dozens of states and local governments with economic boycotts protesting social or political injustices in foreign lands.

The appeals court upheld a decision by a lower federal court that struck down the so-called Burma law.

Although the appeals court found that "human rights conditions in Burma are deplorable," it said the Massachusetts law "interferes with the foreign affairs power of the federal government and is thus unconstitutional."

Massachusetts, which purchases $2 billion in goods and services annually, enacted its law in 1996 because of human rights violations by Burma's military dictators.

The decision could affect more than 20 states and local governments -- including New York City, San Francisco and Portland, Ore. -- that have Burma boycott laws.

The appeals court also ruled that Massachusetts had no right to single out a specific trading partner for a boycott and no authorization to regulate activities in Burma through economic sanctions.

The lawsuit was brought by the National Foreign Trade Council, which represents 580 major U.S. corporations. The Massachusetts law affected more than 30 member companies, but NFTC officials refused to identify them for fear consumers will boycott the firms.

Massachusetts had argued that Congress must decide whether a state or local government may enact legislation that affects foreign affairs. Congress, the state argued, enacted federal sanctions against Burma several months after Massachusetts enacted its law -- and chose not to override the state law. Furthermore, the state isn't regulating conduct, it is merely choosing how to spend taxpayers' money, attorneys said.