Prosecutors on Friday charged a 45-year-old man with a history of mental problems with illegally entering an elementary school in Uji, Kyoto Prefecture, last month and attempting to kill students there.

Nobuyuki Shirai entered Uji Elementary School on Dec. 18, armed with a kitchen knife, and attacked two 7-year-old boys in a first-grade classroom on the second floor, according to the indictment.

The two boys -- Junichiro Nishiike and Mizuki Nakatsuka -- suffered minor head cuts.

Shirai, who has been hospitalized 23 times with mental problems, made incoherent and emotional remarks upon his arrest.