TOKYO — Japan had been bracing itself for bad news since reports emerged that its nationals were among those missing after the first exchanges of gunfire in last week's In Amenas hostage crisis.

But nothing could prepare it for confirmation that the 37 hostages killed during four days of violent exchanges between militants and Algerian troops included 10 Japanese employees of the Yokohama-based engineering firm JGC Corp.

After the last three victims were identified late last week, Japan emerged with the highest death toll of any country with workers at the gas complex in southeastern Algeria. It was the single biggest loss of Japanese lives overseas since the September 11 terrorist attacks, in which 24 died.

While the rest of the world grappled with the emergence of a new front in the fight against Islamist terrorism, clearly frustrated Japanese officials rued the country’s inability to protect its many citizens working in dangerous parts of the world.

Over the weekend, TV images showing coffins being removed from a government plane at Tokyo’s Haneda instantly shattered the illusion that Japan was largely immune to international terrorism.

In Tokyo, there was barely concealed frustration that the aggressive tactics of Algerian armed forces may have put the hostages’ lives at even greater risk.

The prime minister, Shinzo Abe, stopped short of criticizing the Algerian authorities, but said the loss of civilian lives during the rescue attempt was “truly regrettable” — as severe a public admonishment as you are likely to see from a Japanese leader.

The loss of life prompted rare public displays of emotion by government ministers, and Takeshi Endo, the JGC spokesman who had spent the week struggling to maintain his composure as he delivered grim updates to a nation gripped by events in the Sahara Desert. Abe said the loss of life had left him “heartbroken.”

At the height of the crisis, officials in Tokyo relied on sketchy information from Algeria and unconfirmed reports from journalists in the region. It was left to the British ambassador in Algiers to inform Japanese officials that the Algerian army had launched an armed offensive against the militants.

Japan’s inability to offer practical help on the ground was particularly galling. In the event of any international effort to secure the hostages’ freedom — an option quickly dismissed by the Algerian government — Japan would have had to depend on special forces from other nations to fight on its behalf.

Tokyo’s impotence in the face of terrorist threats to its own citizens could have far-reaching political repercussions. The postwar “pacifist” constitution prohibits its forces from taking part in combat missions overseas; when Japan sent troops to southern Iraq in February 2004 — and arguably made itself a target for Islamist terrorism — it was to help with reconstruction and humanitarian relief, not to fight.

In light of last week’s bloody events in north Africa, Abe, a conservative who has long called for Japan to behave like a “normal” military power, is pushing for changes that would boost the country’s intelligence capability. He also wants to set up a version of the US National Security Council and, crucially, to remove the legal shackles from its self-defense forces (SDF).

Changes to the law could be debated when parliament reconvenes next week. They would allow the SDF to engage in operations to rescue Japanese citizens involved in emergencies overseas — a move supported by 71 percent of respondents in a Kyodo news agency poll released this weekend. Currently, the law only authorizes the SDF to transport Japanese by sea or air from areas that have already been deemed safe.

Abe knows he must tread carefully to avoid accusation that he is exploiting civilian deaths to push his bold defense agenda.

“To force troops, who must make life or death decisions in a split second, to act within the limits of the law or risk violating it, is a harsh restriction," he said. "But we have no intention of using [the hostage deaths] to try to pass such a revision to the law.”

Taken to their natural conclusion, the changes could bring revisions to Article 9 of the constitution, which prohibits the use of force as a means of settling international disputes, to allow Japan to come to the aid of an ally under attack — a move certain to ring alarm bells in East Asia.

The secretary general of the governing Liberal Democratic Party [LDP], Shigeru Ishiba, was less cautious than Abe, saying that Japanese troops should be allowed to use force to rescue citizens caught up in crises overseas.

"It is the government's primary responsibility to protect the lives and property of Japanese nationals,” Ishiba, a former defence minister, said in a televised debate Sunday. “The minimum necessary use of weapons isn’t the same as the use of force” referred to in the constitution.

Newspaper editorials reflected public anger over the government’s inability to even attempt to save Japanese lives. "The government was late in taking measures to deal with the situation because it could not get the information it needed to manage the crisis,” the Mainichi Shimbun said.

The start of a potentially ground breaking debate on national security comes too late for the JGC victims and their grieving families, of course.

The firm, which has had a presence in Algeria for more than 40 years, had refused to release the identities of the dead men, or of the seven employees who escaped.

Instead, the families of the victims broke the silence to pay public tribute to their loved ones. They included Fumihiro Ito, JGC’s project director in Algeria.

The 59-year-old was born in Minamisanriku, one of the towns destroyed by the March 2011 earthquake and tsunami. His mother, Fukuko, lost her home in the disaster and lives alone in temporary housing. Now she has lost her only son.

Fumihiro had been due to visit her next month to celebrate his 60th birthday. “He called me on 11 January to tell me he was going to Algeria on business,” she told the public broadcaster NHK. “That was the last conversation we had."

“I never thought for a moment that something awful like this would happen. I can’t stop crying. I can’t function. Even drinking is difficult. There is nothing left for me now.”