For weeks before assassinating Shinzo Abe, Tetsuya Yamagami prepared, stockpiling improvised firearms and explosives and studying the former Japanese prime minister’s program. Mr Yamagami, 41, shot Mr Abe twice on Friday while the politician was giving a speech in central Nara, a city in western Japan, to support a candidate for Sunday’s upper house election. He used a makeshift weapon made of metal and wood, with two barrels attached with tape and a pistol grip, which produced a tremendous noise and white smoke. The police said they found other three-, five- and six-barrel guns at Mr. Yamagami’s home, as well as rudimentary explosives. Mr Yamagami was arrested soon after Mr Abe was shot, who died five hours later in hospital. The attacker made no attempt to flee, witnesses say, as he was confronted by Mr. Abe’s security detail. Police said Mr Yamagami confessed to wanting to kill the former prime minister. A former member of Japan’s navy, in which he served a three-year term ending in 2005, Mr Yamagami lived in Nara and most recently worked for a construction company in the nearby Kansai region, according to the Asahi Shimbun newspaper. He resigned in April, saying he was “tired” and has been unemployed since then, the newspaper said, citing former colleagues of Mr Yamagami. A neighbor of Mr Yamagami recalled seeing him two days before the attack, saying he ignored her greeting. “He seemed very nervous, so I felt he didn’t like interacting with people,” the 69-year-old retiree, who gave her name only as Nakayama told Reuters. “Now that I think about it, at the time it looked like something was bothering him.” According to Japanese media, citing police sources, Mr Yamagami told investigators he believed Mr Abe was linked to a religious group it accused of financially ruining his mother and breaking up their family. Police earlier said the crime was motivated by “hate towards a specific group,” which they did not identify. The killer told police he studied Mr. Abe’s program online as he built weapons to kill him. He also hoped to kill a leader of the unnamed religious group, according to multiple reports. Jeffrey Hall, a specialist lecturer in Japanese studies at Japan’s Kanda University of International Studies, said the vague wording used by the police about Mr Yamagami’s motive was likely intended to avoid any discrimination against the team’s fans, as well as to avoid any impact on Sunday’s election. “Japanese society is generally suspicious of younger religious groups, the word ‘cult’ will be used quite often,” Mr. Hall said, adding that several groups speculated online to be linked to the incident “are of foreign origin. although probably many of their fans in Japan are Japanese.” He said police and the media walk a fine line, as withholding information can lead to conspiracies and accusations that authorities are doing so because they are controlled by the groups involved. “This type of reporting, which may be motivated by a desire to prevent discrimination or a desire to prevent unfair impact on the election, could ultimately lead to a backlash against whatever group that person is affiliated with and possibly others that are exactly similar. added Mr. Hall. Although conspiracy theories are not as dominant or influential in Japanese politics as they are in some Western societies, particularly the United States, Mr. Hall said that “if you look up the name of any of these new religions along with the name of a politician, they will come up with theories about them, regardless of whether there is any real evidence for it.’ A right-wing nationalist who has sought to restore traditional practices in Japan, Mr. Abe has had ties to various religious groups, targeting conservative believers as a steady source of votes for his Liberal Democratic Party. Mr. Abe served as a “senior adviser” to Nippon Kaigi, a right-wing lobby group that also counts many other LDP leaders as members. Nippon Kaigi promotes respect for traditional Shinto beliefs, including visits to the controversial Yasukuni Shrine, where Japanese war dead are buried, including those responsible for World War II atrocities. There are also ties between both Mr Abe and the LDP and the Unification Church, which quickly became a trending topic on Japanese social media on Saturday. Many commentators have resurfaced excerpts from a speech by Mr Abe at an event organized by the group last year, alongside former US President Donald Trump and Cambodian leader Hun Sen. Now officially known as the Family Federation for World Peace and Unification, the church was founded by South Korean pastor Sun Myung Moon in 1954 and is known for cultivating ties with conservative politicians around the world. The group had ties to the LDP dating back decades, including to Mr. Abe’s father, former Japanese foreign minister Shintaro Abe. There are dozens of Unification Church ministries across Japan, with one in Nara less than 500 meters from where Mr. Abe was shot, according to the group’s official website. In recent years, an offshoot of the Unification Church led by the late Mr. Moon’s son, Hyung Jin Moon, has also begun to expand in Japan. The Pennsylvania-based World Church of Peace and Unification — also known as the Rod of Iron Ministries — is notorious for its attachment to guns, with members participating in religious services carrying assault weapons. The Family Federation did not immediately respond to requests for comment. Timothy Elder, director of global missions for Sanctuary Church, said the group had no information indicating any connection between Mr. Yamagami and the church. “Shelter families in Japan did everything they could to support Shinzo Abe during his tenure as prime minister,” he added. “It is absurd that any of them would seek to harm him.” Filed by Reuters. The Morning Update and Afternoon Update newsletters are written by Globe editors, giving you a concise summary of the day’s most important headlines. Sign up today.