NEW YORK — A man accused of kidnapping, killing and dismembering an 8-year-old boy who asked him for directions was ordered Thursday to undergo a psychological evaluation after his attorney told a judge that his client might be mentally ill.

“He has indicated to me that he hears voices and has had some hallucinations,” said the attorney, Pierre Bazile.

Levi Aron, 35, pleaded not guilty to charges of murder and kidnapping as prosecutors said he lured Leiby Kletzky to his home Monday after the young boy got lost while walking home from an Orthodox Jewish day camp.

Video cameras captured the fateful encounter between the two on a Brooklyn street, while Leiby’s mother waited anxiously just a few blocks away. Detectives later found the boy’s severed feet, wrapped in plastic, in the man’s freezer, as well as a cutting board and three bloody carving knives.

At his arraignment Thursday afternoon, Aron appeared disheveled, confused and pale. He stayed quiet during the brief court proceeding. As he was led out of the courthouse holding cells, other inmates screamed obscenities at him. He was held without bail, placed on suicide watch and in protective custody after his attorneys said they feared he could harm himself.

Police and prosecutors said Aron, a clerk at a hardware supply store, has confessed to suffocating the boy with a bath towel, but they continued to work on verifying his horrific and bizarre explanation for the boy’s death.

At a news conference, Police Commissioner Raymond Kelly said Aron told investigators that after taking Leiby off the street Monday, he brought the boy to a wedding in the suburbs about 35 miles away and spent several hours there.

Other wedding guests confirmed Aron was there but didn’t see the boy, the commissioner added.

By the time the pair returned to the city, it was so late that Aron decided to take Leiby to his home to sleep and left him there Tuesday while he went to work, according to the police version of the confession.

Aron told police he killed Leiby when he got home after being spooked by a massive search for the boy.