Prosecutors in Japan have formally charged the man suspected of assassinating former Prime Minister Shinzo Abe with murder.

The suspect, Tetsuya Yamagami, 41, was arrested right after he allegedly shot Abe with a homemade gun, as the former leader was making a campaign speech in July outside a train station in Nara in western Japan.

Yamagami underwent a nearly six-month mental evaluation, which ended Tuesday. He was found fit to stand trial, according to prosecutors.

Yamagami was also charged with violating a gun control law, according to the Nara District Court.

JAPAN'S SHINZO ABE ASSASSINATION: WHO IS SUSPECT TETSUYA YAMAGAMI?

Shinzo Abe suspect taken into custody after shooting

FILE - Tetsuya Yamagami, bottom, is detained near the site of gunshots in Nara Prefecture, western Japan, on July 8, 2022. Japanese prosecutors formally charged the suspect in the assassination of former Prime Minister Shinzo Abe with murder, Japan's NHK public television reported Friday, Jan. 13, 2023. (Katsuhiko Hirano/The Yomiuri Shbun via AP, File)

Police have said Yamagami told them that he killed Abe, one of Japan’s most influential and divisive politicians, because of Abe’s apparent links to a religious group that he hated. 

In his statements and in social media postings attributed to him, Yamagami said he developed a grudge because his mother had made massive donations to the Unification Church that bankrupted his family and ruined his life.

A lawyer for Yamagami told the Associated Press that it will likely be several months before his trial begins due to the complexity of the case.

Shinzo Abe assassination suspect walking into a police station in Japan

Tetsuya Yamagami, the alleged assassin of Japan's former Prime Minister Shinzo Abe, enters a police station in Nara, western Japan, on Jan. 10, 2023. (Kyodo News via AP)

Police are also reportedly considering adding several allegations, including weapons production, violation to explosives control law and causing damage to buildings.

JAPAN'S SHINZO ABE SHOT AND KILLED: WORLD LEADERS PAY TRIBUTE TO FORMER PRIME MINISTER

Japan Shinzo Abe when he was prime minister

Japanese Prime Minister Shinzo Abe speaks during a press conference at the prime minister official residence on August 28, 2020, in Tokyo, Japan. (Franck Robichon - Pool/Getty Images)

Some Japanese have expressed sympathy for Yamagami, especially those who also suffered as children of followers of the South Korea-based Unification Church, which is known for pressuring adherents into making big donations and is considered a cult in Japan.

Thousands of people have signed a petition requesting leniency for Yamagami, and others have sent care packages to his relatives or the detention center.

TRUMP MOURNS SHINZO ABE, ‘A UNIFIER LIKE NO OTHER’ WHO 'CHERISHED HIS MAGNIFICENT COUNTRY' 

Suspect in shooting of Japanese former prime minister Shinzo Abe is detained

A police officer detains a man, believed to have shot former Japanese Prime Minister Shinzo Abe, in Nara, western Japan July 8, 2022. (The Asahi Shimbun/via REUTERS)

Abe's assassination sent shockwaves throughout Japan and the world. The dramatic shooting was caught on video.

Abe was shot about two minutes and 20 seconds into his speech, according to Japanese news outlet NHK. 

Video captured prior to the shooting purportedly shows Yamagami scanning his surroundings while standing near a footpath behind Abe. 

SHINZO ABE DEAD: JAPAN'S LONGEST-SERVING PRIME MINISTER WAS CONSERVATIVE KINGMAKER WHO STRENGTHENED US TIES

Shinzo Abe assassination

Japan’s former Prime Minister Shinzo Abe, center, falls on the ground in Nara, western Japan Friday, July 8, 2022.  (Katsuhiko Hirano/The Yomiuri Shimbun via AP)

He then takes something out of a bag he was carrying and walks slowly toward Abe, coming several yards away from him, before raising the gun and opening fire, the station added.

CLICK HERE TO GET THE FOX NEWS APP 

Abe was Japan's longest-serving prime minister. He served from 2006 to 2007 and again in 2012 until he resigned in 2020 after his ulcerative colitis, a chronic condition, resurfaced, calling his decision at the time "gut-wrenching."

Prime Minister Shinzo Abe right before he was shot

In this image from a video, Japan’s former Prime Minister Shinzo Abe makes a campaign speech in Nara, western Japan shortly before he was shot Friday, July 8, 2022.  (Kyodo News via AP)

During his term, he focused on the economy, rebuilding Japan's military and being a larger player in international affairs. 

The Associated Press, Fox News' Brie Stimson and Greg Norman contributed to this report.