The man suspected of a mass stabbing at a facility for the disabled that left at least 19 dead and at least 25 wounded was hospitalised earlier this year after he said he would kill disabled people if the government approved.
Satoshi Uematsu was "involuntarily committed" to hospital on 19 February, when police in the town of Tsukui contacted him after he tried to hand a letter to the speaker of the lower house of Japan's parliament.
Uematsu, 26, told police he would kill many severely disabled people if the national government approved such an action, a city official told Reuters.
In the letter, he advocated euthanasia for disabled people.
"My goal is a world in which, in cases where it is difficult for the severely disabled to live at home and be socially active, they can be euthanised with the consent of their guardians," he wrote, according to Japanese broadcaster NTV.
He also boasted he had the ability to kill 470 disabled people in what he called was "a revolution," and outlined an attack on two facilities, after which he said he will turn himself in.
He asked to be judged innocent on grounds of insanity, be given 500 million yen ($5 million) in aid and plastic surgery so he could lead a normal life afterward.
He was discharged on 2 March after a doctor deemed his condition had improved, the official added.
Staff at the Tsukui Yamayuri En facility in Sagamihara, south of Tokyo, called police around 2.30am local time (5.30pm GMT Monday) after the suspect broke into the building and began his attack.
Uematsu killed at least 19 and wounded 25 others in Japan's worst mass killing in decades. Kyodo news agency said the dead ranged in age from 19 to 70 and included nine men and 10 women.
He was arrested arrested when he handed himself in to police at 3am local time, reportedly telling officials he wanted to "get rid of the disabled from this world".
Other reports said he held a grudge after being fired from his job at the facility.
He was carrying a bag full of knives and other sharp tools when he handed himself in, some of which were bloodstained.
Mass killings are rare in Japan and typically involve stabbings due to the country's strict gun laws.
Eight children were stabbed to death at a school in Osaka in 2001 and seven people died in 2008 when a man drove a truck into a crowd and began stabbing people in the Akihabara shopping district.
Members of a doomsday cult killed 12 people and made thousands ill in 1995 in simultaneous sarin nerve gas attacks on five Tokyo rush-hour subway trains.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies