TOKYO — One minute, Shinzo Abe, Japan’s most influential former prime minister, was stumping for a junior politician from his party near a train station in Japan’s old capital city of Nara. The next minute, Mr. Abe had collapsed and was bleeding on the street, shot twice in the neck, doctors said, by a gunman who the police said later admitted he had come to kill him.
Less than six hours later, Mr. Abe, Japan’s longest-serving prime minister in history, was dead at age 67.
The assassination on Friday morning — in the midst of a campaign for a parliamentary election scheduled for Sunday that had been largely ignored by the public — sent shock waves across Japan, with some of the strictest gun laws in the world and a general public unaccustomed to such violent crime.
The shooting comes at a pivotal moment for Japan, as it is trying to stake out a stronger leadership position in the region in the face of mounting threats from its neighbors China and North Korea. And with images of extreme violence from Ukraine and the United States playing out on screens in Japan, the public is unsettled by the possibility that their own nation may not be as safe as they thought.
Shortly after the shooting, police arrested Tetsuya Yamagami, 41, at the scene. He has been charged with murder. Police officials said he used a homemade gun and confessed that he had intended to kill Mr. Abe because he believed the former prime minister to have some association with a group against which Mr. Yamagumi held “a grudge.”
“I am in complete shock,” said Ayane Kubota, 37, commuting home from work in Tokyo and scrolling through Twitter to catch up on the news on Friday evening. “This is so un-Japanese. You never hear about gun violence here. On TV in the United States you hear about it all the time, but not here.”
Mr. Abe, a transformative figure in the Japanese political landscape, leaves behind a notable legacy. At home, he sought to turn Japan into what he called a “normal” country, able to defend itself and even engage in combat after more than 70 years of pacifism imposed in a constitution written by postwar American occupiers.
But he could also be polarizing for his right-wing views about constitutional reform, women’s rights to keep their names after marriage and historical revisionism about Japan’s wartime atrocities. On social media, he was attacked by some commenters even as he lay dying in the hospital.
In a news briefing on Friday night, police officials from the Nara prefectural office said Mr. Yamagumi had made the double-barreled gun, about 16 inches long and 7 inches wide, and that police had found several similar weapons in his apartment near the site.
Condolences poured in from around the globe for Mr. Abe, who had forged relationships with world leaders during his nearly eight year tenure. As a jet-setting diplomat, he worked closely with allies but also reached out to countries like Russia with which Japan had thorny relations. When the United States wavered in its commitment to Asia, Mr. Abe cast Japan as the regional leader upholding free trade and the rule of law against an increasingly aggressive China.