The top court of the United Nations has ordered the US to halt sanctions on 'humanitarian' goods to Iran.

The sanctions were imposed by US President Donald Trump, after he pulled out of a nuclear deal with Tehran.

The International Court of Justice unanimously ruled that Washington "shall remove by means of its choosing any impediments arising from the measures announced on May 8 to the free exportation to Iran of medicines and medical devices, food and agricultural commodities" as well as airplane parts, said judge Abdulqawi Ahmed Yusuf.

The court said sanctions on goods "required for humanitarian needs ... may have a serious detrimental impact on the health and lives of individuals on the territory of Iran."

US sanctions on aircraft spare parts also had the "potential to endanger civil aviation safety in Iran and the lives of its users", according to the court.

Mr Trump slapped a first round of sanctions on Iran in August, after pulling out in May of a historic deal aimed at curbing Tehran's nuclear ambitions, to the dismay of his European allies.

A second round of punitive measures was due next month.

The International Court of Justice rules on disputes between UN member states.

Its decisions are binding and cannot be appealed, but it has no mechanism to enforce them.