A mother who called herself a "demon assassin" has pleaded guilty to killing her two youngest children, and stabbing two others, during an attempted exorcism.

Zakieya Avery, 31, admitted attacking her four children with her roommate, Monifa Sanford, during a crazed religious ceremony intended to rid them of evil spirits.

Avery's 18-month-old son, Norell, and two-year-old daughter, Zyana, were both killed in the attack — the youngest being stabbed more than 20 times before his toddler sister was then choked and stabbed through the chest.

Avery's two older children — Taniya, 5, and Martello, 8 — were also stabbed during the ritual, but survived despite suffering punctured lungs.

Avery confessed to the January 2014 attack at Montgomery County Circuit Court on Monday (12 September).

The court heard how she believed her children were possessed by evil spirits and that the only way to send them back to God was by killing their "bodies" so demons inside could be released.

Monifa Sanford
Monifa Sanford Montgomery County Police

"Satan will not take my kids," Avery is alleged to have said during the attacks at her Germantown home, about 30 miles north of Washington DC.

Baby Norell was the first to be set upon by the two women after his mother hallucinated his eyes were turning black and his nose was bleeding. The pair then moved from child to child as they believed each had become possessed.

The guilty plea has led to a trial over whether she was criminally insane at the time of the stabbings, to determine if she will be sent to prison for a possible four life sentences, or — like her roommate — to psychiatric hospital for treatment.

"The only way to understand her actions in this case is to factor in her mental illness, her delusional belief that her children were being possessed by demons," Neil Blumberg, a psychiatrist retained by an attorney for Avery, testified.

"She clearly at the time thought that this was the proper and moral thing to do. She was acting in an altruistic way — as she had done previously when she was less mentally ill."

The court also heard details of a notebook police found in the two women's townhouse, which included shopping lists for "Demon Assassin" gatherings and journal entries, the Washington Post reported.

"We live in a society where we have a surface of demonic demons lurking over the world," read one entry, made just weeks before the attacks. "They're in our clothes, our shoes, computer chips, radio, all of the things we live in."

A video recording of Avery in a police interrogation room on the day she was arrested was also played in court, with the hidden camera footage showing the mother move her hands up and down her body, and at times grabbing at thin air.

Blumberg said she appeared to be "talking to something that is not there".

Monday's hearing saw Avery speak softly as she answered a list of questions from the Judge, Terrence McGann regarding her plea.

She was seated as prosecutor Peter Feeney then read a long account of the attacks, with Avery at one point using a tissue to dab her eyes. The horrific details saw some in the court gasp and sob.

Last year, Avery's roommate, 24-year-old Monifa Sanford, was sent to a maximum-security psychiatric hospital after pleading guilty and being ruled criminally insane by a Montgomery County judge. Her legal defence successfully argued she couldn't tell the difference between right and wrong during the attacks.

Court records show Avery had a history of mental illness before being arrested. Judge McGann, presiding over the case, will have to determine whether she had capacity during the attacks and was able to appreciate she was breaking the law.

The hearing continues.