Prosecutors on Thursday said a court extended the detainment of the man accused of fatally shooting former Prime Minister Shinzo Abe in order to examine his mental fitness.

Tetsuya Yamagami, 42, will be detained until Feb. 6 instead of Nov. 29 as originally scheduled, the Nara prosecutors said.

Yamagami is being investigated for murder after Abe was shot while giving a campaign speech in the city of Nara on July 8. Yamagami was arrested on the spot.

Under Japan's Penal Code, those with diminished capacity are subject to reduced punishments, while anyone whose actions were due to insanity cannot be punished.

The pre-indictment psychiatric evaluation is being carried out as the shooter's criminal liability is expected to be a major part of his trial. Yamagami's defense could request a separate test after his indictment, extending the pre-trial process.

Yamagami has told investigators that he held a grudge against the Unification Church, a religious group known for its mass weddings, and targeted Abe because he thought the former prime minister had links to it, according to investigative sources.

His uncle has told reporters that Yamagami's mother donated large sums of money to the church — formally known as the Family Federation for World Peace and Unification — and subsequently went bankrupt in 2002, ruining the family.