Testimony in the trial of a man who killed seven co-workers ended Friday with a psychiatrist saying the defendant fabricated an elaborate delusion about killing Nazis so he would appear insane.

Dr. Malcolm Rogers, testifying for prosecutors, told the jury that Michael McDermott was faking mental illness and began laying the groundwork for his insanity defense before the killings.

McDermott, a 43-year-old software engineer, has pleaded innocent by reason of insanity. He has testified that he believed he was killing Adolf Hitler and six Nazi generals.

Prosecutors contend McDermott killed his colleagues because he was angry over the company's decision to withhold some of his salary to pay back taxes.

When McDermott was arrested immediately after the Dec. 26, 2000, killings at Edgewater Technology, he said: "I don't speak German" and asked a state police trooper if she spoke English. When she said she did, McDermott said, "Oh, Thank God."

Rogers, the psychiatrist, said Friday he believes McDermott planned those remarks ahead of time so that when he later told his story about the Nazis, it would seem logical.

"I do think it's part of the fabrication of the psychosis," Rogers said.

Defense psychiatrists testified earlier that McDermott suffers from schizophrenia and was delusional the day he killed his co-workers.

Rogers acknowledged that McDermott suffers from depression and a personality disorder, but said he is not psychotic and understood what he was doing the day of the shootings.

"In fact, it is my opinion that he was faking psychosis, and that he planned the faking prior to the crime," Rogers testified.

The jury is expected to begin deliberations Monday, following closing statements by attorneys.