The Japanese, who inhabit one of the safest countries in the world, have been reminded in brutal fashion that the world is a dangerous place.

In a shock to a country that can feel insulated from distant geopolitical problems, two of their own have reportedly been killed by Islamic radicals in Syria, the latest apparently beheaded in a video posted online this weekend by militant websites.

This island nation, which once closed itself to the outside world for two centuries under samurai rule, has been venturing out as it has in fits and starts for the past two decades. Prime Minister Shinzo Abe, in a bid to restore Japan's position in the world, has been driving his country to play a larger international role, most controversially seeking to loosen constitutional restraints put on its military after World War II.

And as Japan has learned before, venturing out inevitably carries risks.

The question then is whether the risks will drive Japan back into its shell. Analysts say it is too early to predict the impact of the crisis on government policy and the public psyche. Past experience, though, suggests that Japan may, after some handwringing, continue what has been a very gradual expansion of its military role. A major test could come in the spring, when the parliament is expected to take up Abe's proposals to allow its Self-Defense Forces to do more.

"Contrary to what some people are arguing, the ongoing hostage crisis will have little to no effect as far as official policy or public opinion is concerned," predicts Jun Okumura, an independent analyst.

Since coming to power about two years ago, Abe has traveled far more widely than his predecessors, meeting dozens of his counterparts in Latin America, Africa, Europe and Southeast Asia.

His most recent trip was to the Mideast, where he pledged humanitarian and development aid last month for the countries battling the Islamic State group. A larger global role includes joining the effort against terrorism, even if Japan cannot contribute troops under a post-World War II constitution that limits its military to defending Japan.

"All that, we shall do to help curb the threat ISIL poses," Abe said in a Jan. 17 speech in Cairo, using an acronym for the militant group that controls parts of Syria and Iraq. "I will pledge assistance of a total of about 200 million U.S. dollars for those countries contending with ISIL, to help build their human capacities, infrastructure, and so on."

His words apparently reached the Islamic State group, which in a video three days later accused Japan of donating money "to kill our women and children" and threatened to kill two Japanese men it held as hostages.

It's not the first time Japan faced such a crisis. It ventured out in a relatively big way in 2004, sending several hundred troops to Iraq to help in the reconstruction. Though in a noncombat role, the overseas deployment was a significant break with past policy. It required special legislation and stretched the self-defense limits imposed by the postwar constitution — some say too far.

At home, many opposed the deployment. In Iraq, half a dozen Japanese were kidnapped. One was found decapitated, his body wrapped in an American flag, after then-Prime Minister Junichiro Koizumi refused demands to pull the troops out of Iraq.

Such violence is shocking anywhere, but particularly so in Japan, which has among the lowest murder and gun ownership rates of anywhere in the world. The troubles of the Mideast can seem farther away than in the United States or Europe. Unlike New York or Paris, Tokyo hasn't been attacked by radicalized Muslims. The most infamous terrorist act in recent times was home grown, the release of poisonous gas in the Tokyo subway system by a religious cult in 1995.

"It is unusual for Japan, which has not participated in the military operations (against the Islamic State group), to be targeted," the Mainichi, one of Japan's major newspapers, observed in an editorial. It concluded: "We no longer live in a time when we can feel safe, just because we are Japanese."

In the decades after World War II, when Japan ventured out in a really big way with disastrous consequences, the country focused on economic growth and relied heavily on the United States, its vanquisher and new ally, for protection from global threats.

It still does today, but Japan has been edging its own military overseas for more than 20 years now, though in a very cautious way.

The risks came home early. Over public opposition, the Japanese parliament passed a law in 1992 that allowed it to dispatch troops and others to U.N. peacekeeping operations. A Japanese police officer was killed in Cambodia the following year.

While the police withdrew from peacekeeping for several years afterward, the Cambodia mission was completed, and the military has continued to join others in the years since, notes Okumura, the analyst.

The 2004 killing of one of the hostages in Iraq increased pressure on the government to pull out its troops, but that mission continued too, until 2006.

A decade later, Abe is trying to push the edge of the envelope a little further. He laid the groundwork when his Cabinet reinterpreted the constitution last year to allow Japan, in some situations, to defend allies that come under attack. He still needs lawmakers to approve legal changes necessary to empower the military to do that and more. Heated debate is expected, but with his party holding a solid majority in parliament, Abe may well get his way.

___

Moritsugu is The Associated Press bureau chief in Tokyo.