Iranian President Hassan Rouhani gave a nod on Friday to Japan's plan to send Self-Defense Forces personnel to the Middle East to help secure the safe navigation of ships amid elevated tensions in the region.

In talks with Rouhani in Tokyo, Japanese Prime Minister Shinzo Abe briefed Rouhani on the envisaged dispatch in detail and the Iranian leader expressed appreciation for Japan's efforts to make its own initiative "transparent," a senior Japanese government official said.

The envisaged dispatch, separate from a U.S.-led initiative to ensure the safe passage of ships near the Strait of Hormuz, has been calibrated not to hurt Japan's good ties with both Iran and the United States.

With a formal decision pending, Tokyo is planning to deploy a destroyer and a patrol plane to enhance its intelligence-gathering capabilities in areas outside the Strait of Hormuz. Such a dispatch remains a sensitive and divisive issue under the war-renouncing Constitution but the Middle East is a critical region for resource-poor Japan.

Abe also expressed "serious concern" about heighted Middle East tensions and said Iran needs to play a "constructive" role in stabilizing the situation.

On a faltering 2015 nuclear deal, Abe told Rouhani that Iran should refrain from taking actions that would undermine it and instead fully abide by it, according to the Japanese official.

Tehran has chipped away at its commitment through breaches such as exceeding the uranium enrichment cap, which came in response to the U.S. withdrawal from the deal and the re-imposition of the sanctions.

Rouhani was visiting Japan as the first Iranian leader since Mohammad Khatami in October 2000, as Tehran apparently hopes to deepen bilateral ties amid the persisting Iran-U.S. standoff over the nuclear deal.

As U.S. President Donald Trump has launched a "maximum pressure" campaign, Iran is struggling under oil and other U.S. sanctions that were reinstated following its pullout in 2018. Increased gasoline prices have sparked widespread protests, adding to the country's woes.

"The nuclear deal is an extremely important agreement for Iran. That's why we strongly condemn the United States' one-sided and irrational withdrawal," Rouhani said in the meeting with Abe at his office in Tokyo, part of which was open to the media.

"We hope that Japan and other countries in the world will make efforts toward maintaining the accord," Rouhani said.

Japan has consistently supported the accord under which Iran promised to curb its nuclear program in exchange for the lifting of sanctions. It was signed between Iran and Britain, China, France, Germany, Russia and the United States.

Experts say Tehran is hoping Japan will resume importing Iranian crude oil to strengthen economic ties.

Rouhani was quoted by the Iranian presidential office as saying that Iran welcomes any plan that can increase economic exchanges and increase oil exports and sales.

During their 10th summit, Abe told Rouhani it is important to cooperate with the International Atomic Energy Agency, which carries out inspections, according to the Japanese official.

Tensions have spiked in the Middle East after a spate of attacks on oil facilities and tankers, including a vessel operated by a Japanese firm near the Strait of Hormuz in June. The United States has accused Iran of being involved.

The areas that the SDF personnel will be deployed are the Gulf of Oman, the Arabian Sea and the Bab el-Mandeb Strait connecting the Red Sea and the Gulf of Aden.

Japan and Iran have built friendly ties over the years, and Abe became the first Japanese leader to visit Tehran since 1978 when he went in June.

Sachi Sakanashi, a senior research fellow at the Institute of Energy and Economics Japan, said it was Rouhani's turn to visit after Abe's trip to Iran.

For Iran, the visit was meant to underscore the country is not suffering from isolation in the world as Japan and Iran have been on good terms for years, according to Sakanashi, an expert on Iranian affairs.

While the Trump administration has hardened its stance on Iran since Washington pulled out of the nuclear accord in 2018, remaining members such as France and Britain have been trying to salvage it.

Efforts are also under way to facilitate trade between Iran and Europe via a scheme that does not rely on U.S. dollars for transactions and can avoid breaking U.S. sanctions.

"With the U.S. sanctions in place and protests at home, Iran has been eager to explore ways to break out of the impasse over the nuclear deal," she said.

Related coverage:

Iran president to hold talks with Japan PM Abe amid Mideast tensions

EXCLUSIVE: U.S. OKs Japan plan for Rouhani visit as Iran seeks to break impasse

Japan PM Abe mulls Middle East trip in Jan. to explain SDF dispatch