President Trump is terminating a little-known “treaty of amity” between the United States and Iran, Secretary of State Mike Pompeo announced Wednesday.

“This is a decision frankly that is 39 years overdue,” the top U.S. diplomat told reporters.

Pompeo took that step following a dispute in the International Court of Justice, in which Iran tried to convince the tribunal to order the United States to continue providing sanctions relief under the 2015 nuclear deal. Trump’s team rejected the court’s authority over the matter under any circumstances; the theory of Iran’s case relied on the existence of a decades-old friendship pact that Pompeo emphasized is obsolete.

“The Iranians have been ignoring it for an awfully long time,” he said. “We ought to have pulled out of it decades ago.”

The court’s ruling Wednesday was a mixed bag for the United States. The court called for Trump to lift sanctions on “humanitarian” goods as well as on spare aircraft parts, saying the restrictions could endanger civilian airplane passengers; the U.S. regards Iranian airlines as a key logistical plank of Iranian terror operations. And the court held open the possibility of additional findings.

"The decision given in the present proceedings in no way prejudges the question of the jurisdiction of the Court to deal with the merits of the case,” the ICJ ruled, per CBS. “It leaves unaffected the right of the Governments of the Islamic Republic of Iran and the United States of America to submit arguments" on the merits or admissibility of the case.”

Pompeo maintained that the United States is providing enough humanitarian relief to the Iranian people. “Having said that, the choices that are being made inside Iran today to use money to foment terror around the world,” he continued. “Those are dollars that the Iranian leadership is squandering, they could be providing humanitarian assistant to their own people but instead have chosen a different path.”

The formal withdrawal from the treaty could also preempt another ruling from the ICJ. “This marked a useful point for us to demonstrate the absolute absurdity of the treaty of amity between the United States and the Islamic Republic of Iran,” Pompeo said.