Iranian President Hassan Rouhani has told North Korea that the United States cannot be trusted, as the US seeks a deal to rein in the North's nuclear and missile programmes.
Iran dismissed a last-minute offer from Washington for talks this week, saying it could not negotiate after the Trump administration reneged on a 2015 deal to lift sanctions in return for curbs on Iran's own nuclear programme.
North Korean foreign minister, Ri Yong Ho, visited Iran as the United States reintroduced sanctions against the Islamic Republic.
"The US administration performance in these years has led the country to be considered untrustworthy and unreliable around the world which does not meet any of its obligations," Mr Rouhani was quoted by the Islamic Republic News Agency (IRNA) as telling Mr Ri during his visit.
"In the current situation, friendly countries should develop their relations and cooperation in (the) international community," he said, adding Iran and North Korea have "always had close views" on many issues.
Mr Ri travelled to Tehran after attending a security forum in Singapore, where he and US Secretary of State Mike Pompeo sparred over an agreement made at June's landmark summit between Mr Trump and North Korean leader Kim Jong-un.
The two sides vowed to work towards North Korea's denuclearisation at the summit, but have since struggled to reach a deal to meet that goal.
North Korea has been pursuing its weapons programmes in defiance of UN Security Council resolutions and sanctions.
Mr Ri told Mr Rouhani that Washington's pullout from the 2015 pact and restoration of sanctions was an "action against international rules and regulations", the IRNA news agency said.
"North Korea's strategic policy is to deepen relations with the Islamic Republic of Iran and confront unilateralism," he said.
Mr Trump decided to restore sanctions against Iran despite pleas from other world powers that had co-sponsored the deal, including Washington's main European allies, Britain, France and Germany, as well as Russia and China.
The sanctions have already led banks and many companies around the world to scale back dealings with Iran.
Companies doing business with Iran will be barred from the United States, Mr Trump said on Tuesday.
Iranian Supreme Leader Ayatollah Ali Khamenei, the highest authority in Iran, said the country had nothing to be concerned about, his official website said.
"With regard to our situation do not be worried at all. Nobody can do anything," Mr Khamenei said.
"They can be sure. There is no doubt about this."