A court on Tuesday granted a request from prosecutors to hold a man, suspected of stabbing a police officer in Osaka Prefecture, in custody through October for psychiatric testing.

The prosecutors will determine whether 33-year-old Yujiro Iimori was mentally sound at the time of last month's attack, in which he also stole the officer's weapon, and if he is competent to stand trial, according to the Osaka District Public Prosecutor's Office.

Iimori was arrested on charges of attempted robbery and attempted murder a day after he allegedly attacked Suzunosuke Kose, 26, with a knife at a police box in Suita, early in the morning of June 16.

Iimori, who has a history of mental illness, told the police he carried out the stabbing because his illness had become worse and people around him were treating him poorly, according to investigative sources. He has refused to talk about the attack itself, they said.

Kose, who suffered several stab wounds, fell into a coma but has since been recovering. Osaka Gov. Hirofumi Yoshimura told reporters Monday that Kose has recovered enough to have a conversation.

Iimori was carrying the gun he stole from the police officer when he was arrested in a mountainous area not far from the crime scene.