BANGOR, Maine — The Virginia woman who stabbed two strangers at Bangor Mall in 2015 was sentenced Tuesday to three years imprisonment and six years of probation.

During the sentencing, it was revealed that Elizabeth Ellis of Alexandria was a former Defense Intelligence Agency translator with an electrical engineering degree who had served in Afghanistan.

Ellis spoke in a clear, calm voice as she apologized briefly to the women she stabbed just before Superior Court Justice William Anderson delivered the sentence on her no-contest plea to two charges of aggravated assault.

“I regret what happened,” Ellis said.

Only one victim was in the courtroom at Penobscot Judicial Center, court officials said. She declined to comment.

Anderson admitted during long discussions with defense attorney Aaron Frey of Bangor and Assistant District Attorney Stephen Burlock during the sentencing that Ellis’ case was strikingly unusual.

Ellis, they said, was a woman with no prior criminal record, great intelligence, extensive service to her country and productivity in society who firmly took responsibility for her actions when she stabbed two women in the shoulders in separate incidents on June 2, 2015, for no apparent reason.

“She didn’t know the victims. She had nothing against them. There was no overt reason why she would commit the offenses,” Anderson said Tuesday.

Ellis could have received a maximum sentence of 10 years on each charge. But Anderson sentenced her to five years suspended sentence and three years probation on the first aggravated assault count. She received a seven-year sentence with all but three years suspended, plus another three years probation, on the second. With time served, Ellis will spend about another year in prison.

Anderson made reference several times to Ellis having a “psychological condition and mental health aspects” to her case — which he said had a bearing on his ruling — and to her telling Farmington police when she turned herself in that the attacks hours earlier were “unprovoked ’cause I am not well.”

But Anderson said he didn’t know what those conditions were.

Court-appointed psychiatrists determined she was competent to stand trial but were not tasked with determining the illnesses from which she may have suffered. Under no contest pleas Ellis avoided pleading criminal insanity, Anderson said.

Ellis also refused to divulge whether she suffered from any illnesses, though some reports indicated Ellis had begun behaving strangely upon her return from Afghanistan about two years ago, Anderson said.

“What do you do with the mental health aspects of the offense? What do you do with all of that when it comes to sentencing? I can’t ignore that,” Anderson said.

Yet the two victims have suffered considerably, Anderson said. Both have recovered from being stabbed once each in the shoulder and back, but both suffered psychological distress. One victim’s psychological distress has been severe, Anderson noted.

Having been incarcerated since the attack, Ellis has already served nearly two years in jail for the attacks. Anderson said he believed the sentence would maintain public safety and that with the six years of probation, Ellis would have to undergo psychological evaluation and hopefully get help. He also directed her to have no contact with the victims and to pay restitution.