Japanese Prime Minister Shinzo Abe on Sunday sought cooperation from Saudi Arabia to ensure stability in the Middle East as he urged all parties involved to exercise restraint amid heightened U.S.-Iran tensions, a senior Japanese government official said.

In his meeting with Saudi Crown Prince Mohammed bin Salman near Al Ula in the country's northwest, Abe expressed his concern about the grave impact that a military conflict in the region would have on the rest of the world.

Both agreed that collective efforts are necessary toward easing Middle East tensions, according to the official.

"A military conflict in the Middle East would have a huge impact on global peace and stability," Abe told the crown prince, who is considered Saudi Arabia's de facto ruler. "I'd like to ask all countries concerned to respond (to the situation) in a restrained manner."

(Japanese Prime Minister Shinzo Abe (R) and Saudi Foreign Minister Prince Faisal bin Farhan shake hands ahead of their talks in Riyadh on Jan. 12, 2020.)

Saudi Arabia has built good relations with the United States while both countries harbor hostility toward Iran. Japan, which maintains friendly ties with Iran, has been encouraging dialogue between Tehran and Washington amid a months-long standoff over a 2015 nuclear deal.

Abe is visiting Saudi Arabia, the world's largest crude oil exporter and a crucial supplier to resource-poor Japan, on the first leg of a five-day trip that will also take him to the United Arab Emirates and Oman. Japan relies on the region for about 90 percent of its oil imports.

Abe also briefed the crown prince on Japan's initiative to send a Self-Defense Forces destroyer and patrol planes to the region to safeguard commercial shipping.

Prince Mohammed told Abe that he "fully supports" the decision, with the two agreeing to coordinate closely toward securing the safe navigation of ships in the region, according to the Japanese official.

(Japanese Prime Minister Shinzo Abe (center L) and Saudi King Salman (center R) attend a welcome ceremony for Abe in Riyadh on Jan. 12, 2020.)

Abe's visit comes as concerns about a U.S.-Iran military conflict have receded somewhat.

U.S. President Donald Trump did not resort to further military action last week against Iran following Tehran's targeting of Iraqi bases hosting U.S. troops with missiles. The Iranian attack was in retaliation for the U.S. killing of a top Iranian commander earlier this month.

Abe also met with Saudi King Salman in Riyadh earlier Sunday and exchanged views on the Middle East situation.

As Riyadh holds the Group of 20 presidency this year, they agreed to work together to make the Saudi-hosted summit meeting of the diverse group in November a success, the Japanese Foreign Ministry said. Japan held the rotating G-20 presidency in 2019.

In recent weeks, Japan has been intensifying calls for all parties to exhaust diplomatic efforts to bring stability to the Middle East.

When Abe met with Saudi Prince Faisal bin Farhan, who serves as foreign minister, on Sunday, the Japanese leader said he is "deeply worried" about the Middle East situation and that Tokyo is aiming to help stabilize it.

Abe's trip to Saudi Arabia, the United Arab Emirates and Oman is aimed at briefing them on Japan's SDF dispatch. Tokyo is seeking to enhance its own intelligence-gathering capabilities in areas that include the Gulf of Oman and part of the Arabian Sea.

But the Strait of Hormuz near Iran, a key shipping lane, is excluded as Japan wants to draw a clear distinction between its mission and a U.S.-led maritime security initiative that Tokyo has not joined.

Related coverage:

Iran apologizes to Ukraine for accidentally shooting down airliner

2 SDF planes leave for Middle East on intel-gathering mission

U.S. slaps Iran with fresh sanctions after missile attacks