An expert witness testified Tuesday that the schizophrenic man accused of killing a psychologist with a meat cleaver knew exactly what he was doing.

“His plan was to rob Dr. Shinbach,” said prosecution witness Dr. Benedict of the attack in February 2008. “He had the ability to think and plan.”

David Tarloff, 45, admits he killed Kathryn Faughey while intending to rob her colleague, psychiatrist Kent Shinbach, with whom she shared an office on the Upper East Side of Manhattan. But his lawyers have mounted an insanity defense.

Tarloff has said he intended to take $40,000 to rescue his mother from a nursing home and take her to Hawaii.

“Its unrealistic but its not disorganized,” Dr. Benedict said.

Tarloff encountered Faughey while searching for Shinbach’s office. He slashed her 15 times with the cleaver and fractured her skull with a mallet, police said.

Tarloff’s lawyers argue that he was too psychotic to be held criminally responsible in thE death of Faughey.

Tarloff says he believes that God had given him permission to steal the money for his mother’s sake, said defense attorney Frederick Sosinsky.

“He believed he was the only one who could rescue her,” Sosinsky told jurors.

Dr. Shinbach had Tarloff hospitalized for the first time over two decades ago but hadn’t seen him since. Medical records reveal that the mental patient had been hospitalized 22 times since then.

Prosecutors acknowledge Tarloff’s illness but say he acted as a calculating criminal.

Evan Kutroy, an assistant defense attorney, told jurors that Tarloff brought weapons to execute the robbery and called prior to his arrival to find out the office’s hours.

If convicted, Tarloff could face up to life in prison with no chance of parole. If his insanity defense succeeds, he could spend an undetermined amount of time in a secure psychiatric facility.