In a two- or three-hour conversation in the middle of the night, Aaron Schaffhausen cried and said he was thinking of killing his three young daughters — thoughts that he believed were being caused by his prescription medication.

His cousin, Liz Daleiden, had called him in Minot, N.D., that night in March 2012 to check on his welfare. She knew he was depressed and wanted to ask why he wasn’t visiting his girls in River Falls, Wis. There had also been inappropriate comments Schaffhausen posted to his girls’ Facebook page that concerned her, Daleiden testified Friday, April 5, in the trial to determine whether the 35-year-old was insane at the time he killed his daughters during an unsupervised visit to their home last summer.

Schaffhausen and the girls’ mother divorced about six months before the killings, which prosecutors say he committed to hurt his former wife — a motive the defense rejects.

Schaffhausen was “not doing well at all” and sounded almost emotionless when she called, Daleiden said. Hoping to help, she asked whether he was feeling suicidal.

“He said, ‘No, I don’t feel suicidal; I feel homicidal,’ ” she told the court. “He said, ‘I took myself off my medication. My medication was causing me to have homicidal thoughts.’ ”

She asked him what kind of homicidal thoughts he was having, and he told her he was afraid of hurting his girls, Daleiden said in St. Croix County Circuit Court in Hudson. She asked him why he would be afraid of doing that.

Schaffhausen then spoke of having driven halfway from Minot to River Falls. When asked why he had done that, Schaffhausen told her that he had begun driving to Wisconsin to cut his girls’ throats, an emotional Daleiden said.

“And then he started crying really hard and hung up,” she told the court. Daleiden immediately called him back and told him he needed to get help. She asked Schaffhausen, who told her he had been drinking, if he wanted someone to stay with him or if she should call his mother. He declined, saying that would only make things worse, she testified.

Worried for Schaffhausen and his children, Daleiden told her mother of the comments, and her mother called her sister — Schaffhausen’s mother, Daleiden said.

Almost a year before that phone call, Schaffhausen had been prescribed medication for depression.

He had visited Dr. Paul McMillan, a River Falls family practice physician, in April 2011, and indicated he felt “depressed and hopeless most of the time,” McMillan testified Friday. McMillan diagnosed Schaffhausen with a moderately severe major depressive disorder during the roughly 30-minute visit.

After not responding to one medication, Schaffhausen was prescribed citalopram and made a significant improvement, said McMillan, who saw Schaffhausen four times.

At the last appointment, in November 2011, Aaron reported being stressed about his divorce, McMillan said. Schaffhausen was still responding to the medication, but not as much as he had been, and the doctor increased the dosage.

McMillan also told Schaffhausen to get therapy, and Schaffhausen did see a counselor twice in 2011 in River Falls.

Licensed social worker Gretchen Link testified about those two visits, saying Schaffhausen was concerned about his marriage and was feeling depressed.

She said she believed Schaffhausen suffered from dysthymia.

“It’s like a low-grade depression that’s ongoing,” Link said.

Schaffhausen reported on a form that he had temper outbursts and had feelings of guilt, shame, anxiety, anger and a lack of self-confidence, she testified. During the second visit it seemed like his drinking had increased, she said.

Link told the court that it seemed that at least some of Schaffhausen’s anger was directed at his ex-wife, Jessica Schaffhausen, Link said.

His anger was also apparent to former Minot construction co-worker and roommate Jon Paul, who testified Friday that in the months leading up to the July 10 killings he witnessed Schaffhausen blurt out several comments about killing his children and ex-wife.

When Paul heard that someone from Minot had killed his children, he immediately thought of Schaffhausen, he said. And when Paul saw something on the Internet saying the girls’ deaths could have been an accident, he believed otherwise.

“I called the detectives’ office because … I knew it wasn’t an accident,” he said.

Paul was the third former co-worker to testify about Schaffhausen making statements about killing his ex-wife and children.

A fourth co-worker, Joseph Rollag, also testified, but told the court he did not remember Schaffhausen talking about killing his ex-wife or children, despite reportedly telling police about such statements after the deaths. At the time he first spoke with investigators, Rollag was not on his medication and could have had “clouded judgment” as a result, he said.

Rollag told the court he lived with Schaffhausen in Minot and described his former roommate as a “great friend” who helped out him and his family.

River Falls resident Gina Larson got to know the Schaffhausen family through her day care and described them as a normal family, she said in testimony Friday. She knew Schaffhausen as someone who was intelligent, calm, friendly and social, she said.

Her husband, Jessie Larson, also testified, saying he knew Schaffhausen to be a “good guy” and said the family were fun, happy people.

The Schaffhausen girls, he added, were good kids.

“Full of life, full of happiness,” Jessie Larson said.

Friday was the fourth day of testimony in the trial. Schaffhausen has already pleaded guilty to the slayings, but the defense is trying to prove his mental state at the time makes him not responsible.

The three girls — Amara, 11, Sophie, 8, and Cecilia, 5 — were found in their beds with their neck cuts. The youngest was also strangled, according to the criminal complaint.

If the defense is successful, Schaffhausen will be committed to a psychiatric institution, possibly for the rest of his life. If not, he will be sentenced to life in prison.

Andy Rathbun can be reached at 651-228-2121. Follow him at twitter.com/andyrathbun.