Japan's relations with Iran are certain to develop further if a final agreement is made on Tehran's nuclear program, Prime Minister Shinzo Abe said.

In a meeting with Iranian President Hassan Rouhani, Abe welcomed a tentative nuclear agreement it struck in early April with Britain, China, France, Germany, Russia and the United States, according to the Japanese government.

On the sidelines of a meeting of Asian and African leaders in Jakarta on Wednesday, Abe expressed hope for Rouhani's leadership to realize the final deal and said he is "convinced" that Japan's political and economic ties with Iran will be strengthened if that is reached, according to the government.

Rouhani reiterated Iran's position that the signing of the agreement is possible within two months if the major powers lift economic sanctions on Tehran, the government said.

Rouhani invited Abe to visit Iran, but the prime minister said the nuclear issue must be settled for that to happen, it said.