A Japanese court on Friday granted a request by prosecutors to conduct a psychiatric examination on a man who was arrested after randomly attacking passengers with a cleaver on a crowded shinkansen bullet train last month, killing a man and injuring two women.

Ichiro Kojima, 22, will be evaluated for mental competency for about four months to see whether he can be held responsible for his actions, according to prosecutors.

(A car of the shinkansen bullet train after the June 9 rampage)

Since he hinted at suicidal thoughts and his explanations of the incident often did not make sense during the investigation, prosecutors had been considering filing a request for the psychiatric examination, investigative sources earlier said.

The attack has revived debate about security on board shinkansen trains.

At around 9:45 p.m. on June 9, Kojima attacked two women in their 20s in the No. 12 car of the 16-carriage bullet train as it was traveling between Shin-Yokohama and Odawara stations in Kanagawa Prefecture near Tokyo, according to investigators.

The train started its journey at Tokyo Station and its final stop was scheduled to be Shin-Osaka Station in western Japan.

Kotaro Umeda, a 38-year-old company employee, had tried to stop the attacker but was stabbed to death by Kojima.

Police arrested Kojima at the scene, and he was served with another arrest warrant on June 29 for the attempted murder of the two women.