KAMLOOPS, B.C. -- A B.C. Supreme Court judge has ordered a psychiatric assessment for a man who claims he killed his ex-girlfriend because he was in the "fight of his life" with a demon.

Christopher Butler has pleaded guilty to second-degree murder in the death of 26-year-old Deanne Wheeler, saying he strangled her with a rope saw and cord and beat her with a rock before stabbing her to death.

B.C. Supreme Court has heard Butler, 41, invited Wheeler to his apartment on Dec. 30, 2014 before killing her.

He went to the RCMP detachment and told police he was waiting for her with the rope saw and wanted to murder her because she was possessed.

Despite those admissions, Justice Keith Bracken said Thursday that there is uncertainty about whether Butler's mental state at the time allowed him to form intent to murder.

Butler told officers he wanted to plead guilty, but he has refused legal assistance and represented himself in court.

Bracken noted that Butler has consistently questioned in court whether he is not criminally responsible by reason of a mental disorder.

"What I killed was not the body of Deanne, but what was inside her," Butler said during one court appearance.

Butler will be sent to the provincial forensic psychiatric hospital for a 30-day assessment. He has been diagnosed with bipolar disorder, mood disturbance and delusional thinking,

Crown lawyer Alex Janse presented evidence through text messages of Butler's increasing jealously and controlling behaviour in the weeks before Wheeler was killed.

Janse said he coaxed the woman to meet him at his apartment on the pretext that they should remain friends.

He told police he strangled Wheeler, describing her as a demon and saying: "When it entered my apartment, I set down the coffee it had bought. We went forward into the living room. It turned around and said, 'You will no longer call me Satan,' and its eyes went huge and black . . . I feared for my life and said, 'Die, demon, die.'"

Butler complained in court that there was no way to test Wheeler for possession by evil spirits, making a comparison to medical staff trying to determine rabies in a dog by killing it and then testing for the virus.

Butler told an undercover police operator placed in jail immediately after his arrest that he knew before Wheeler arrived at his apartment that he would kill her.

"He also commented that demons breathe the same air that we do and that you have to cut off the air supply," Janse said.

Butler told Bracken that he understands his crime.

"I did kill Deanna Wheeler. That's why I'm here to take responsibility," he said.

"Deanna was a good person. She was a human being. I don't understand," Butler said. "At the same time, I'm a victim in this."

Court heard that on three occasions, he went to Wheeler's home, where she lived with her parents, in the middle of the night. He was turned away one time by her father.

At another time, he wrote "I love you" all over a truck in front of her house. He also left notes and phoned her repeatedly.