A woman who has twice stabbed Maryland shoppers in random knife attacks, most recently slashing a woman outside a Target store in Lanham, will again be sent to a mental health facility for treatment.

Antoinette C. Starks entered a plea Wednesday of guilty but not criminally responsible, Maryland’s version of an insanity defense, to an attempted murder charge. Starks has been diagnosed with paranoid schizophrenia.

Prince George’s County Circuit Court Judge Larnzell Martin Jr. said given the state’s most recent mental health assessment that Starks did not comprehend the effect of her crime, he had no choice but to accept the plea. Martin sent Starks back to the state-run Clifton T. Perkins Hospital Center.

Starks has been in the care of the Jessup facility since shortly after she used steak knives to stab a woman who was loading her van in the Target parking lot in 2011. Before that, she attacked several shoppers with butcher knives in a Bethesda Nordstrom store in 2005.

Both times she taped pairs of knives together, inflicting deep wounds on female shoppers.

Antoinette Starks (Prince George’s County police)

Before agreeing to the plea deal, Martin asked whether the victim was aware of the deal. Assistant State’ s Attorney Katina Steuart said the victim was but did not want to attend the sentencing.

John Erzen, a spokesman for Prince George’s State’s Attorney Angela Alsobrooks, said the plea was the appropriate outcome.

“We are happy that she is held accountable for her crimes but also happy that she will be getting the help that she needs,” Erzen said. “She will be held indefinitely. Until further notice.”

Starks, who was neatly dressed in dark clothes, appeared calm and, when asked, declined to make a statement in court.

Public defender Allen E. Wolf said Starks had been on medication and stabilized for months.

Since she was arrested more than 18 months ago, Starks has undergone repeated mental health evaluations by the state’s Department of Health and Mental Hygiene, with differing results.

Last spring, she was found competent to stand trial. After another evaluation last summer, she was labeled incompetent to stand trial. This spring, she was again found competent to stand trial, and her attorneys filed a motion to hold her not criminally responsible. It is similar to the conditions under which she was admitted to state treatment after the 2005 attack and released months before the 2011 attack.

Wolf tried to explain the differing results of her evaluations over the past year and a half, saying Starks had suffered a decline after initially being arrested. Since then, and with regular treatment, she had improved, he said.

“In the jail, she went down, and got worse and worse. By March, she had recovered enough that we could continue the case,” Wolf said.

Wolf said any release or partial release to a halfway house, where she had been living before the last attack, would have to be cleared by a judge.

It is rare for an individual ruled not criminally responsible to be released and then rearrested for a nearly identical violent crime.

Citing patient privacy laws, state health officials declined to comment Wednesday on Starks’s sentence or how long she might remain under treatment.