Secretary of State Mike Pompeo said Wednesday that the White House was terminating a 1950s treaty with Iran after a United Nations court ruled the accord prevented the US from imposing sanctions that would affect humanitarian aid.

“We’re disappointed that the court failed to recognize that it has no jurisdiction to issue any order relating to these sanctions measures with the United States, which is doing its work on Iran to protect its own essential security interests,” Pompeo said during a news conference at the State Department.

The United Nations’ highest court ordered the US to ensure that sanctions against the Islamic Republic that will be strengthened next month do not imperil humanitarian aid or civil aviation in the country.

The International Court of Justice, ruling in favor of Tehran, said the sanctions reinstated after President Trump pulled out of the Iran nuclear deal in May would violate the terms of a 1955 Treaty of Amity between the two countries.

In response, Pompeo said the US would pull out of the treaty, an action that is “39 years overdue.”

“Iran has attempted to interfere with the sovereign rights of the United States to take lawful actions as necessary to protect our national security and Iran is abusing the ICJ for political and propaganda purposes,” he said.

The country’s top diplomat said the US would continue to provide humanitarian assistance but called on Iranian officials to do more to protect their citizens instead of spreading terror around the globe.

“Those are dollars the Iranian leadership is squandering, they could be providing humanitarian assistance to their own people but have chosen a different path,” Pompeo said.

Last Friday, the US said it would close its consulate in Basra, Iraq, and relocate personnel there because of increasing threats from Iranian-backed militia.

“Iran is the origin of the current threat to Americans in Iraq,” Pompeo said. “Our intelligence in this regard is solid. We can see the hand of the ayatollah and his henchmen supporting these attacks on the United States.”