Prime Minister Shinzo Abe and Iranian President Hassan Rouhani agreed Tuesday to initiate regular contact over threats raised by the newly emerged Islamic State militant group in the Middle East, a Japanese official said.

The leaders agreed that their governments would meet periodically, including at the foreign-minister level, said Deputy Chief Cabinet Secretary Hiroshige Seko, who attended the talks.

Abe asked Rouhani to help get humanitarian aid to people and nations affected by the militant group, Seko said.

Rouhani said Iran would work with Japan on the matter and voiced concern about rising instability in the region, Seko said.

But the Japanese and Iranian leaders did not discuss airstrikes by U.S.-led forces against Islamic State targets in Syria, he said.

Meanwhile, Abe urged Rouhani to "use flexibility" in talks with the United States and other countries over Iran's nuclear programs, Seko said.

Abe said his nation would offer Iran investment and assistance in sectors such as environmental conservation if the nuclear issue is settled.

Iran and the five U.N. Security Council permanent members plus Germany have been working on signing a comprehensive agreement on the nuclear program by a Nov. 24 deadline.

Abe and Rouhani were meeting on the sidelines of the U.N. General Assembly. They last met a year ago, also on the fringes of the U.N.'s gathering of world leaders.

Later in the day, Abe had separate meetings with Mongolian President Tsakhiagiin Elbegdorj and Egyptian President Abdel Fattah el-Sisi.

Abe and Elbegdorj agreed to work together to settle the issue of North Korea's past abductions of Japanese nationals, while el-Sisi asked Abe for Japanese financial assistance and corporate investment, the official said.