The gunman accused of killing Japan's former prime minister Shinzo Abe pleaded guilty Tuesday, three years after the assassination in broad daylight shocked the world.

The slaying forced a reckoning in a country with little experience of gun violence, and ignited scrutiny of alleged ties between prominent conservative lawmakers and a secretive sect, the Unification Church.

"Everything is true," Tetsuya Yamagami said at a court in the western city of Nara, admitting to the murder of the country's longest-serving leader in July 2022.

The 45-year-old was led handcuffed into the room with a rope around his waist.

When the judge asked him to state his name, Yamagami, who was wearing a black T-shirt and had his long hair tied back, replied in a barely audible voice.

His lawyer said they would contest certain charges, including violations of arms control laws for allegedly using a handmade weapon.

Yamagami's trial had been a long time coming after the discovery of a suspicious item -- later found to be harmless -- caused its last-minute cancellation and the evacuation of the Nara court building in 2023.

One issue central to the case was whether extenuating circumstances applied due to "religious abuse" in Yamagami's childhood stemming from his mother's extreme devotion to the Unification Church, according to Japanese media reports.

Prosecutors told the court that Yamagami started building up resentment toward the Church, which he thinks derailed his life.

"He began to think he needed a gun" to attack Church executives, but having failed to procure one "he decided that he had to make one himself", a prosecutor said.

Yamagami "thought he could draw public attention to the Church... if he killed someone as influential as Abe", the prosecutor said.

The former prime minister had spoken at events organised by some of the church groups and received some criticism for doing so.

- Life 'ruined' -

Yamagami reportedly resented Abe for his perceived ties to the Church, which was established in South Korea in 1954 and whose members are nicknamed "Moonies" after its founder Sun Myung Moon.

The Church has been accused of fomenting child neglect among its members and financially exploiting them, claims it denies.

Yamagami's lawyers on Tuesday said his life collapsed because of the sect, with his mother convinced "throwing all her money and assets into the Church will salvage her family" after the suicide of her husband and the illness of one of her sons.

In the end, she donated around 100 million yen ($1 million at the time) to the sect, the lawyer said.

Yamagami gave up on advancing to higher education and joined the military instead, while his mother declared bankruptcy, according to the lawyer.

He also attempted suicide in 2005.

"He began to think his whole life was ruined by the Church," the lawyer said.

Investigations after Abe's murder led to cascading revelations about close ties between the Church and many conservative lawmakers in the ruling Liberal Democratic Party, prompting four ministers to resign.

Earlier this year, the Tokyo District Court issued a dissolution order for the Church's Japanese arm, saying it caused "unprecedented damage" to society.

The assassination was also a wake-up call for a nation with some of the world's strictest gun controls.

Gun violence is so rare in Japan that security officials at the scene failed to immediately identify the sound made by the first shot, and came to Abe's rescue too late, a police report after the attack said.

The debacle prompted lawmakers to pass a bill in 2024 further strengthening arms controls to prevent people from making homemade guns.

Under the new rules, uploading tutorial videos on making firearms and propagating information about gun sales on social media can result in a fine or imprisonment of up to one year.