The Trump administration has announced it will exit a 1955 Treaty of Amity with Iran after the International Court of Justice (ICJ) ruled Wednesday that the US must abide by parts of the treaty.

The unanimous ruling ordered the United States to remove “any impediments” to the export of humanitarian goods to Iran, as well as on goods related to the safety of civil aviation. It further stated that the US could not limit financial transactions related to those goods.

The ruling did not challenge the bulk of the US sanctions Iran had sought to invalidate, including the most painful ones against Iran’s petroleum sector slated to go into effect on Nov. 5. But the case did throw a long-obscure treaty into the limelight and deal an unwelcome challenge to the Trump administration’s reimposition of sanctions following its unilateral withdrawal from the Iran nuclear agreement.

“This decision is binding so the US will have to comply with it,” Gentian Zyberi of the Norwegian Centre for Human Rights told Asia Times.

“It is interesting to note the decision of the court is unanimous. Even the ad hoc judge appointed to the case from the US has agreed,” he added.

The Trump administration responded by exiting the 1955 Treaty of Amity, Economic Relations and Consular Rights, which requires a year’s notice to go into effect. US National Security Advisor John Bolton also took the opportunity to lambast the international judicial system as a whole.

“The ICJ failed to recognize that it has no jurisdiction to issue any order with respect to sanctions the United States imposes to protect its own essential security,” Bolton told reporters hours after the ruling.

The hawkish national security advisor announced that President Trump had decided to not only withdraw his country from the 1955 amity treaty, but also to exit an optional protocol and dispute resolution linked to the Vienna Convention, which governs international diplomatic relations.

“This is in connection to a case brought by the so-called state of Palestine, naming the US as a defendant, challenging our move of our embassy from Tel Aviv to Jerusalem,” Bolton said.

These withdrawals, Bolton explained, were about more than the individual cases but about rejecting binding rulings against the United States.

“This really has less to do with Iran and the Palestinians than the continued consistent policy of the United States to reject the jurisdiction of the International Court of Justice.

“It relates obviously in part to our views on the International Criminal Court (ICC) and to the nature of so-called purported international courts to be able to bind the United States,” he said.

Trump in his United Nations General Assembly speech last month lambasted the ICC, but had not touched on the ICJ.

Bolton warned that the administration would henceforth “commence a review of all international agreements that may still expose the United States to purported binding jurisdiction dispute resolution in the International Court of Justice.”