SEOUL (AFP) - North Korea’s ceremonial head of state has vowed to strengthen ties with Iran and reaffirmed a shared hostility towards the United States during a meeting with Iran’s leader, state media said Sunday.

Kim Young-Nam, attending a summit of the Non-Aligned Movement in Tehran, met with Mahmoud Ahmadinejad on Saturday to clarify Pyongyang’s “firm stand” to boost ties with Iran, the North’s KCNA said.

Kim stressed the need for more bilateral exchanges among high-level delegations as well as to boost economic and diplomatic ties during the talks that took place in a “friendly atmosphere”, it added.  The Iranian authorities said boosting bilateral relations would be beneficial to both nations, praising the North’s “steadfast anti-imperialist, anti-US stand”, KCNA said. “At the talks both sides exchanged views on... strengthening cooperation on the joint anti-imperialist, anti-US front and in the non-aligned movement,” it said.

Kim Young-Nam also met Iranian parliament speaker Ali Larijani Saturday and expressed Pyongyang’s support for Iran’s drive for “peaceful nuclear energy”, the Fars news agency said.

North Korea and Iran are both subject to international sanctions over their nuclear activities and their governments share a deep hostility towards the US. During Kim’s latest trip to Iran, the two countries also signed an agreement to cooperate on science, technology and education, KCNA said. Kim Young-Nam acts as head of state because the country’s late founding leader Kim Il-Sung has been declared “eternal president”.  The impoverished but nuclear-armed North is led by Kim Il-Sung’s grandson Kim Jong-Un.

An Iranian delegation visited North Korea in July for talks and the two sides put forward a “common front against imperialism and hegemony”, the North’s state media said earlier.

In May 2011 a UN sanctions report said the two countries were suspected of sharing banned ballistic missile technology, a charge denied by Tehran.