Andrea Pia Yates told a jail psychiatrist the day after her arrest that she drowned her five children to save them from eternal hell, the doctor testified Friday.

"My children were not righteous. I let them stumble. They were doomed to perish in the fires of hell," Yates told Dr. Melissa Ferguson, the medical director of psychiatric services at the Harris County Jail.

Ferguson was the first witness to testify for the defense in Yates' capital murder trial, and she painted a picture of a delusional woman obsessed with images of Satan.

Ferguson said Yates told her during the first jail evaluation on June 21 that she was a bad mother. Yates cried and moaned loudly toward the end of Ferguson's assessment.

"It was the seventh deadly sin. My children weren't righteous. They stumbled because I was evil," Ferguson quoted Yates as saying. "The way I was raising them they could never be saved. ... Better for someone else to tie a millstone around their neck and cast them in a river than stumble. They were going to perish."

She then screamed: "I was so stupid! Couldn't I have killed just one to fulfill the prophecy? Couldn't I have offered Mary?" -- a reference to her 6-month-old daughter.

Then she calmly asked, "Are they in heaven?"

Yates is charged with capital murder in the deaths of Mary, Noah, 7, and John, 5. She called police to her Clear Lake home June 20 and admitted drowning the children in the bathtub along with their brothers Paul, 3, and Luke, 2.

Yates, 37, has pleaded not guilty by reason of insanity. Prosecutors are seeking the death penalty.

Prosecutors rested their case earlier in the day after hearing testimony from Dr. Harminder Narula of the Harris County Medical Examiner's Office. He performed autopsies on Noah, Paul and Luke.

The defense, which has the burden of proving Yates was legally insane at the time of the killings, opened its case with Ferguson's testimony. For jurors to find Yates legally insane, they must conclude she had a severe mental illness and did not know right from wrong.

Ferguson was one of several doctors treating Yates during her first week in jail, and her eyes welled with tears during her testimony.

Although Yates told Ferguson her children were doomed, she described her husband, Russell Yates, as "a righteous husband, a perfect husband."

Ferguson, who interviewed Yates several times during her first week in jail, said Yates told her she drowned the children because "they had to die to be saved."

To fulfill "the prophecy," Yates told Ferguson, Satan had to be destroyed.

"She told me in fragments what the prophecy was, but it didn't make sense," Ferguson testified.

Ferguson testified that Yates believed alternately that she was marked by Satan and that she was Satan -- indicating she had changing delusions.

Yates, who has been on a suicide watch since her arrest, once asked Ferguson for a razor to shave her head so she could see whether the satanic numbers "666" were on her head.

Yates also talked about a satanic character in the recent movie O, Brother, Where Art Thou? who told her, "You have eluded me long enough."

Yates told Ferguson that the message verified that she was marked by Satan.

Yates said she could hear Satan behind the jail walls and heard growling noises coming from the hallway. To "calm the beast," she said, she put her plastic food tray in the doorway at a certain angle, Ferguson testified. She also said she heard Satan's voice coming through the intercom in her cell.

Ferguson said she asked Yates whether she realized how sick she was, but that Yates insisted she was not mentally ill. She had no insight into the severity of her disease or that she was profoundly depressed, Ferguson testified.

"She said, `It's not depression. I never cried,' " Ferguson said. "She couldn't understand psychosis at all when I tried to explain it."

Yates also believed television cartoon characters spoke to her and her children, Ferguson said. The messages to the children were "Don't eat too much candy" and "Your mother's feeding you too much cereal."

Yates also was convinced that there was a camera watching her from the cell's light fixture and asked Ferguson how long she had been under surveillance. She also believed the media had put cameras in her house years ago to monitor her behavior as a mother.

Ferguson said Yates was immediately put on anti-psychotic and anti-depressant drugs and that she continues to take multiple doses of four medications.

Ferguson said Yates' posture was stooped, her head bowed and a sore on her lip was bleeding the first time they met. Her hair also looked as if it needed washing. Jail nurses reported that Yates refused to use soap in the shower.

"In all the patients I've treated for major depression with psychotic features, she is one of the sickest I've ever seen," said Ferguson, noting that she had treated 6,000 patients when she stopped counting several years ago.