Japanese Prime Minister Shinzo Abe and Iranian President Hassan Rouhani agreed Wednesday to uphold the 2015 Iran nuclear deal even after President Donald Trump withdrew the United States from the agreement in May.

In a meeting in New York, Abe and Rouhani discussed the reinstatement of sanctions by the United States against Iran and a U.S. demand that countries halt oil imports from Tehran by Nov. 4, a Japanese Foreign Ministry official said.

(Pool photo)

The official declined to reveal details of the talks, especially when Japan has been asking for a waiver during negotiations with the United States.

Tehran accounts for about 5 percent of Tokyo's total crude oil imports.

In the meeting held on the sidelines of the U.N. General Assembly, Rouhani sought Japan's cooperation in ensuring the implementation of the Iran nuclear deal, and Abe responded that Japan continues to support it, according to the official.

Abe was quoted as telling Rouhani that Iran's constructive role is indispensable for ensuring stability in the Middle East.

Under the deal struck between Iran and six major powers -- Britain, China, France, Germany, Russia and the United States under Trump's predecessor Barack Obama -- Tehran agreed to curb its nuclear activities in exchange for the lifting of crippling economic sanctions.

Abe and Rouhani, meanwhile, agreed to cooperate in denuclearizing North Korea, according to the Japanese official.

The Japanese prime minister expressed his expectation that Iran will play a role in full implementation of U.N. sanctions on North Korea to compel it to give up its nuclear weapons program.

Abe said Japan will continue to extend assistance to Iran in the fields of the environment, medicine and disaster risk reduction.