NEW YORK (AP) – A mental patient who was accused of stabbing a 10-month-old girl in her stroller because he felt he “had to kill something” is mentally unfit to stand trial on attempted murder charges, a Manhattan judge ruled Friday.

State Supreme Court Justice Charles Solomon said his ruling on Bernard Derr’s mental fitness was based on testimony by psychiatric professionals last month. At least four said they believed Derr was mentally incompetent.

The baby, Isabelle Avins, was stabbed in the abdomen while she was out with her nanny, Parbattie Ramroop, 44, at 5 p.m. on Sept. 7 at 171st Street and Fort Washington Avenue in Washington Heights.

Derr, 48, was arrested a short time later in the Fort Washington Avenue apartment building where he and other supervised mental patients live, and taken to the Bellevue Hospital Center prison unit.

In a statement filed in court, Derr said his two roommates had “been getting on my nerves.” He said they had harassed him so much that he took a knife “and went outside and stabbed the baby in the stroller because I had to kill something.”

The baby, who underwent surgery, has continued to recover, her father, attorney Jon Avins, said last month.

After reviewing the psychiatric testimony from the hearing on April 27 and 28, Solomon said, “I don’t have much choice. I’m going to find him incapacitated.”

“As he sits here today, the defendant is not fit to proceed,” Solomon said. The judge said Derr will be sent to a state mental health facility and medicated until he is found fit to stand trial and then he will be returned to court.

Derr’s Legal Aid Society lawyer, Deborah Wright, said she was pleased with the ruling. “Now he’ll get the help he needs,” she said.

Assistant District Attorney Evan Krutoy said he wanted the court and his office to be alerted when Derr is found mentally fit.