Japan's Prime Minister Shinzo Abe, on a visit to the Middle East hoping to calm ease tensions sparked by the killing of top Iranian general Qassem Soleimani, has warned that military confrontation with Iran will harm peace and stability across the world.

Abe's comments came at the start of a five-day Gulf tour that had been thrown into doubt after Tehran responded to the assassination of Soleimani by firing missiles at bases hosting US troops in Iraq, prompting fears of all-out war.

More:

But as those concerns receded, Abe decided to go ahead with the visit and on Sunday discussed regional tensions during an hour-long meeting with Saudi Arabia's Crown Prince Mohammed bin Salman in northwestern al-Ula province, according to Japanese foreign ministry spokesman Masato Ohtaka.

"Any military confrontation in the region that includes a country like Iran will have an effect not only on peace and stability in the region but the peace and stability of the whole world," Abe said, according to Ohtaka.

Abe called "on all relevant countries to engage in diplomatic efforts to defuse tensions", Ohtaka added.

The spokesman said the two leaders agreed on working closely on maritime security in the region and discussed Tokyo's decision to send a destroyer for intelligence activities along with two P-3C patrol aircraft to the Middle East.

Japan, however, has said it will not join a US-led coalition in the region.

Tokyo has walked a fine line in balancing its key alliance with Washington and its long-standing relations and interests with Tehran.

Ohtaka said Abe stressed the importance of a continuous and stable Saudi oil supply to Japan.

The prime minister's tour will also include visits to the United Arab Emirates and Oman.