Legal scholars and trade policy experts say that President Trump is right to claim broad powers to prohibit companies from trading with foreign countries thanks to a 1977 law that has previously not garnered much attention outside the context of national security.

The law, the International Emergency Economic Powers Act signed by Democratic President Jimmy Carter, gives the president sweeping powers to restrict trade once a "national emergency" is declared.

"The president can impose a virtual embargo on a nation under IEEPA," said John Yoo, director of the public law and policy program at the University of California at Berkeley and a former official in George W. Bush's Office of Legal Counsel.

The law has been used in the past to enact sanctions on hostile regimes such as Cuba, Iran, North Korea, and Syria. The Trump administration is now suggesting using it as a trade negotiation tool. On Sunday, Treasury Secretary Steven Mnuchin said China was an "enemy" of the United States on trade.

The IEEPA was preceded by the Trading with the Enemy Act of 1917, which gave the president broad powers to restrict trade in times of war. The 1977 law gave the executive branch similar powers in peacetime. The president still has to declare an emergency to activate the authority, Yoo said, but could do so at his discretion.

Trump tweeted on Friday, "Our great American companies are hereby ordered to immediately start looking for an alternative to China, including bringing your companies HOME and making your products in the USA." He later followed up in another tweet that he was referring to the IEEPA, stating, "Case closed!"

White House officials subsequently said that the president was not actually ordering U.S. businesses to cease trade with China, but contended that he had the full power to do so.

"Ultimately we do have such authority, but it is not going to be exercised presently," White House economic adviser Larry Kudlow told CNN on Sunday.

Kudlow's is an accepted reading of the law, said Gary Hufbauer, nonresident senior fellow for the Peterson Institute for International Economics. "It grants a lot of power, and it has been used to enact pretty comprehensive sanctions in the past, such as with Venezuela."

The law states that the president may "nullify, void, prevent or prohibit, any acquisition, holding, withholding, use, transfer, withdrawal, transportation, importation or exportation of ... any property in which any foreign country or a national thereof has any interest." A 1981 Supreme Court decision, Dames & Moore v. Regan, affirmed that the White House had broad powers under the law.

Ironically, Hufbauer noted, the 1977 law was initially part of an effort to limit the president's powers to prohibit trade. The 1917 Trading with the Enemy Act gives the president broad powers to limit trade in wartime, and many lawmakers believed it was often invoked on flimsy pretexts in the six decades following its enactment. President Richard M. Nixon, for example, used it in 1971 in response to a national postal workers strike.

Congress passed the National Emergencies Act in 1976 in the wake of the Watergate crisis to limit the executive branch's powers to declare an emergency outside wartime. The following year, Congress amended that law by passing the IEEPA to clarify that peacetime economic sanctions could be enacted by the president but could also be overriden by an act of Congress. However, the Supreme Court ruled in 1983 that Congress could not override trade sanctions.