On Tuesday, local media reported Iranian Foreign Minister Mohammad Javad Zarif and his North Korean counterpart Ri Yong Ho met for talks in Tehran.
The US has recently impose crippling sanctions on both countries in respect of their nuclear programmes.
Following the meeting, which came hours after US re-imposed sanctions on Tehran, on Wednesday the Iranian President stated that Tehran welcomed the prospect of pace and security through the Korean Peninsula in order to establish new trade links with the country.
During a meeting with Ri, Mr Rouhani said: “Tehran is willing to develop and deepen international relations and cooperation in all fields, including with Pyongyang.
“Iran and North Korea have always had close views and supported each other in many critical international points and the global community.”
According to Rouhani’s own Mehr press agency, he also spoke of the US withdrawal from the Iran nuclear deal, saying the move resulted in complete loss of faith in Washington.
The Korean foreign minister stressed that the goals of deepening ties with Iran and “confronting unilateralism” were the country’s strategic priorities.
The surprise meeting comes as US-Iran relations are further strained amid the first wave of the US reinstated sanctions coming into force.
On Tuesday, north Korean state media implored the US to lift its sanctions accusing Washington of leveraging the punitive measures to “raise its negotiating power”.
The North Korean leader promised to “complete denuclearisation of the Korean peninsula”, but has as yet has shown little will to curb nuclear weapons development.
State-run newspaper Rodong Sinmun, which is the official newspaper of the Central Committee of the Workers’ Party of Korea, wrote in a Monday editorial: “There have been outrageous arguments coming out of the US State Department that it won’t ease sanctions until a denuclearisation is completed, and reinforcing sanctions is a way to raise its negotiating power.”
The US has demanded Kim Jong-un relinquish his nuclear weapons before sanctions are lifted.