Months of Japan’s efforts to walk a fine line between an antagonized Iran and the United States were put to a crucial test Wednesday as Tehran staged two separate ballistic missile attacks on two Iraqi bases hosting U.S. troops, sending tensions soaring in the Middle East.

Prime Minister Shinzo Abe will cancel a planned visit to the region scheduled to start Saturday due to the attacks, government officials said. Abe had planned to visit Saudi Arabia, the United Arab Emirates and Oman.

But Tokyo will “make a decision” on the timing of the trip “after closely monitoring the local situations,” Chief Cabinet Secretary Yoshihide Suga told a news conference in Tokyo.

Despite the escalating situation, Tokyo does not currently intend to change its planned deployment of a Self-Defense Forces destroyer and two patrol airplanes on the sea off Yemen and Oman, Suga added.

“An intelligence-gathering unit is necessary to ensure the safety of Japan-related ships,” he said.

“There has been no change in that policy. We will prepare for the dispatch while closely watching the local situations.”

Koichiro Tanaka, a professor at Keio University and a noted Japan-based expert on Iranian affairs, said that Abe probably canceled his diplomatic trip out of concern that he could be pressed to make clear which country Tokyo supports — either the U.S. or Iran.

“If his visit had coincided with that of a high-ranking U.S. official like U.S. Defense Secretary (Mark) Esper, Japan would be regarded as a member of the U.S.-led coalition,” Tanaka said.

In fact, Japan for months has tried to maintain a neutral political position by endeavoring to maintain a good relationship with both Washington and Tehran at the same time.

Japan imports nearly 90 percent of its crude oil from the Middle East. Iran accounted for 5.2 percent of the total in 2017.

But experts say it remains unclear whether Tokyo will be able to maintain its neutrality if the tense situation escalates into war.

Fears of a full-scale war emerged suddenly following Friday’s U.S. assassination of Gen. Qassem Soleimani, a top Iranian commander who was greatly revered by Iranians.

In retaliation for the killing, Iran’s Islamic Revolutionary Guard Corps fired more than a dozen ballistic missiles at the two military bases in Iraq.

Tehran and Washington have blamed each other for causing the military crisis. U.S. officials have claimed the killing of Soleimani was necessary to save many American lives.

Asked if Tokyo will support the position of either Iran or the U.S., Suga didn’t directly answer. He instead only emphasized that Japan calls on “all the countries to make efforts to ease tension, “apparently trying to maintain Tokyo’s long-cherished reputation as a politically neutral presence in the Middle East.

“The Japanese government is deeply concerned over the rising tension in the Middle East. Further escalation must be avoided,” Suga said during the news conference.

“For that purpose, all diplomatic efforts should be made,” he said.

Japan, a long-time U.S. military ally, has faced criticism from President Donald Trump for not defending its own tankers navigating through the Persian Gulf, relying on American military forces stationed there instead.

Prompted by Washington, Tokyo announced last month a plan to send two patrol airplanes and a destroyer to the sea off Oman and Yemen in January and February, respectively, for “intelligence-gathering” missions.

But Tokyo wasn’t told of the U.S. plot to assassinate Soleimani in advance and didn’t expect the military tension would rise sharply the way it has, a senior Japanese diplomat in Tokyo said.

“I wouldn’t say we had expected something like this,” the Foreign Ministry official said, referring to the U.S. assassination of Soleimani.

“We’ve made preparations assuming tension could rise, but this may be somethingclose to a worst-case scenario,” the official said, speaking on condition that they remained anonymous.

Japan has officially emphasized that its mission is intelligence-gathering only and that its operations are “independent” of the U.S.-led multinational maritime patrol force now operating around the Strait of Hormuz, the strategic choke point of the Persian Gulf next to Iran.

But Japanese officials also admitted the Maritime Self-Defense Force unit would provide the intelligence it gathered to the U.S.-led patrol forces.

According to the Associated Press, Iran’s state-run IRNA news agency reported that the Islamic Revolution Guard Corps issued a warning against any ally countries siding with the U.S.

“We are warning all American allies, who gave their bases to its terrorist army, that any territory that is the starting point of aggressive acts against Iran will be targeted,” the Guard said.

Asked about the warning during the news conference, Suga said Japan had already communicated with both the U.S. and Iran before adopting its MSDF dispatch plan.

“We are well aware of such (warnings). … But we have already explained to both the U.S. and Iran” about the MSDF dispatch, he said.

Abe is expected to face political challenges on the domestic front, too.

A five-month ordinary Diet session will start around Jan. 20, and opposition lawmakers are ready to grill him and other Cabinet ministers over the controversial dispatch plan to the Middle East.

Any overseas deployment of the SDF is a politically sensitive issue in light of the war-renouncing Constitution, which strictly limits the force to operations for the defense of the country.