The man who fatally shot former Prime Minister Shinzo Abe checked YouTube when making the firearm used in the attack on Japan's longest-serving leader, investigative sources said Sunday.

The sources also said Tetsuya Yamagami, 41, has stated that he tested a homemade gun at a facility connected to a religious group he harbored a grudge against. Yamagami has said his mother made a "huge donation" to the organization, which he believes Abe was associated with.

The Nara prefectural police believe he had tested the weapon ahead of the attack. Yamagami fatally shot 67-year-old Abe on Friday as he was delivering a House of Councilors election stump speech outside a train station in Nara, just two days before voters went to the polls.