TOKYO--Few foreign leaders have courted President Donald Trump as assiduously as the prime minister of Japan, Shinzo Abe.

Since Trump’s election victory in November, Abe has been an eager guest at Trump Tower in New York and at Mar-a-Lago, the president’s Florida resort, where the two men bonded in February over golf and responded to a North Korean missile test in full view of diners.

Now, as Trump and the leader of North Korea, Kim Jong Un, exchange increasingly fiery words over the North’s nuclear weapons program, Abe’s relationship with the president is being tested. The North’s accelerating military advances--and Trump’s volatile response--could complicate Japan’s close alliance with the United States and Abe’s political future.

Abe, analysts say, has sought favor with Trump for two reasons: to blunt the president’s criticism of Japan on trade issues--a recurring theme for Trump during his run for office--and to ensure the president’s commitment to Japan’s defense. During the campaign, Trump sometimes suggested he would scale back the United States’ global military commitments, a policy that would have left Japan, a U.S. treaty ally, exposed.

But now, if anything, Abe faces the opposite problem: a U.S. president who seems overtly eager to confront their mutual adversary, North Korea.

“If it looks like the U.S. set off the chain of events that led to escalation, and Abe didn’t use his relationship with Trump to moderate that, it’s easy to imagine that there would be a domestic price to pay,” said Tobias Harris, a Japan analyst at Teneo Intelligence, a political risk consultancy based in New York.

The Japanese public has much less appetite for brinkmanship than Trump appears to have, Harris said.

Abe, a staunch conservative, has made a career of arguing for a tougher line against North Korea. The growing threat from the North has bolstered his drive to strengthen Japan’s military, which has long been constrained by the country’s war-renouncing constitution.

Because of that, the latest escalation of tensions might seem to play into Abe’s hands.

On Thursday, North Korea said it was drawing up plans to launch intermediate-range ballistic missiles into waters near Guam, a U.S. territory that is home to an important Air Force base in the Pacific. The missiles, it said, would fly over western Japan--reviving memories of a North Korean missile that flew over northern Japan in 1998, causing a national uproar.

“The DPRK has already acquired the capabilities of reducing the Japanese archipelago to ashes in a second once it makes up its mind,” the North’s state news agency said in a statement accompanying the Guam plan, using the initials for the country’s official name, the Democratic People’s Republic of Korea.

Japan is already moving to strengthen its anti-missile defenses, and officials are debating whether to acquire weapons like long-range cruise missiles that would allow the country to strike targets in North Korea, either in retaliation or pre-emptively if it concluded that an attack by the North was imminent.

Deploying such weapons would break with decades of precedent, and the idea is contentious. In keeping with the pacifist constitution, Japan’s military is meant to protect the country from direct attack, while its partner the United States handles offensive duties like striking enemy bases--a shield and spear arrangement.

Most Japanese appear happy with that division of labor, despite concerns about North Korea, and Abe needs to tread carefully if he hopes to change it.

The prime minister’s approval ratings have tumbled in recent months, specialists say, in part because voters believe he is overreaching in his efforts to roll back restrictions on the military, including with controversial proposed changes to the constitution. Polls show that only about one-third of voters support such constitutional changes.

“Abe will want to spend his dwindling political capital on his long-held goal of constitutional revision,” James L. Schoff, a senior fellow at the Carnegie Endowment for International Peace, wrote in an article posted Thursday. A “bold move” to acquire offensive weapons, he added, “would undermine this effort.”

Abe faces a leadership contest in the governing Liberal Democratic Party next year. His main rival, Fumio Kishida, a former foreign minister, appears to be betting that the public favors a more cautious approach to transforming the military.

“In terms of our philosophies as politicians, to put it simply, Abe is a conservative. One might even call him a hawk,” Kishida said Thursday on a television debate program, adding, “I’m a liberal, a dove.”

Trump’s combative language on North Korea makes matters trickier for Abe. The president has doubled down on his war of words with Kim’s government, saying a previous threat to rain down “fire and fury” on the North might not have been tough enough.

In Japan, such comments have served as a reminder of the risks involved in confronting the North militarily. Despite the North’s recent development of ballistic missiles that experts say could reach the United States, North Korea’s neighbors would probably bear the brunt of its attacks. For that reason, support for military action against the North is low in both South Korea and Japan--a fact that Trump’s statements are hardly helping to change.

“There’s growing concern,” said Hideshi Takesada, a specialist on defense issues at the Institute of World Studies at Takushoku University, “about whether the U.S. is really thinking about the security of Japan and South Korea.”

(August 11, 2017)