EVERETT — Mukilteo mass killer Allen Ivanov pleaded guilty Monday to multiple counts of murder, a day before the Snohomish County prosecutor was scheduled to announce whether he would seek the death penalty for the killings.

Ivanov, 20, now faces a mandatory sentence of life in prison.

The courtroom filled with the sound of weeping Monday as Snohomish County Superior Court Judge Janice Ellis read the names of the dead and wounded. It was a necessary step in making certain Ivanov fully understood the crimes he was admitting.

The judge also made certain Ivanov knew she will have no option but to order him to serve life in prison at sentencing, now scheduled for Jan. 12.

“You understand that is what the law requires?” Ellis asked.

Ivanov told her he did.

He pleaded guilty to three counts of aggravated first-degree murder and two counts of attempted murder. All of the charges are connected to his decision to open fire with a military-style rifle July 30 at a Mukilteo house party.

The former University of Washington Bothell student admitted the killings of Anna Bui, Jacob Long and Jordan Ebner, all 19. He’s also acknowledged trying to murder Will Kramer, who was shot in the back, and shooting at other young men as they ran for cover.

Prosecuting Attorney Mark Roe was scheduled Tuesday to announce whether he’d seek death for Ivanov.

“I was undecided as late as this weekend,” Roe said after Monday’s hearing.

Under state law related to capital punishment, a willingness to plead guilty and accept responsibility is a mitigating factor, deputy prosecutor Adam Cornell told the judge.

Late last week, Ivanov’s attorneys approached Roe about the possibility of resolving the case with guilty pleas. For that to happen, however, the prosecutor had to agree not to seek death.

The decision was reached after consulting with the families of those who were slain. Not everybody agreed with the strategy, but “there was confidence expressed by all” in the prosecutor’s decision, Cornell said.

Last week, the judge turned aside a request from Ivanov’s attorneys that she extend until sometime next year the deadline for Roe to announce whether prosecutors would seek the Mukilteo man’s death. The judge said the law was clear: The decision on whether to seek death was solely up to the prosecutor.

In pleadings and arguments made during last week’s hearing, Ivanov’s attorneys suggested there was evidence he has been living with untreated neurological problems and potential mental illness. Preliminary testing indicated his brain development is consistent with somebody years younger.

Ivanov attorney Walter Peale said there was “almost zero” likelihood that his client would have been acquitted of all charges had he opted to take the case to trial. The primary goal of the defense was to keep Ivanov alive, he said.

“Certainly there were reasons for the defense to be concerned. The criminal acts themselves were horrendous” and the consequences for the families terrible to consider, Peale said.

He praised Roe’s willingness to consider not seeking death.

During the hearing, Ellis questioned Peale about his earlier concerns regarding Ivanov’s mental health and ability to understand the legal consequences of entering a plea.

The attorney said his client had subsequently been examined by another expert who concluded that Ivanov was fit to make such a decision. That led to consultation between the experts.

“I think there is general agreement that he is good to go,” Peale told Ellis.

Ivanov was 19 this summer when he allegedly began talking about killing Bui, his former girlfriend.

He bought a Ruger brand AR-15-style rifle with two 30-round clips in the days before the shootings. He later told police that he’d never fired the weapon before heading to the house party he knew Bui would be attending.

Prior to the gunfire, Ivanov wrote a six-page letter, explaining that he was upset over the end of his relationship with Bui. He insisted there was nothing wrong with him or the way he thinks.

“I’m selfish. That’s why I did this,” Ivanov wrote.

From jail, Ivanov also wrote rap lyrics about the “murder game,” and appeared to directly reference the Mukilteo shootings. He enlisted his mother’s help in mailing the lyrics to a convicted killer he met while they both were awaiting trial in the county jail.

Roe on Tuesday is scheduled to announce whether he plans to seek death for John Reed, 53, who is charged with aggravated murder for the April 11 killings of an Oso couple. Patrick Shunn and Monique Patenaude were found buried in a makeshift grave several miles from their home. They’d been involved in a property dispute with Reed, which got worse after the deadly 2014 mudslide made his land unsafe for habitation.

Gov. Jay Inslee two years ago ordered a moratorium on executions. The decision does not bar prosecutors from pursuing the death penalty.

Roe has not sought the death penalty in each of the other three aggravated murder cases brought here since Inslee’s announcement. However, the prosecutor has made clear his decisions have been based on the unique facts of each case, not Inslee’s moratorium. One of those cases led to a quick guilty plea and a 30-year sentence. In the others, prosecutors were convinced there were mitigating factors that likely would have led jurors not to recommend death.

There is now just one person from Snohomish County under a death sentence in Washington. Byron Scherf was sentenced to die for the 2011 strangulation of corrections officer Jayme Biendl in the prison chapel at the Washington State Reformatory in Monroe. The repeat rapist already was serving a life sentence at the time of the murder. He remains locked up in the state penitentiary, pursuing his appeals.

From the start, Peale said, Ivanov has admitted responsibility. The young man feels deep remorse over the harm he caused, although expressing that has been difficult given the status of the case, the attorney added.

Scott North: 425-339-3431; north@heraldnet.com. Twitter: @snorthnews.

Allen Ivanov statement on plea of guilty

Here are excerpts from Allen Ivanov’s handwritten guilty plea:

“On or about July 30, 2016, in Mukilteo, WA, knowing it was a crime to do so, I used a Ruger AR-15 style rifle to shoot several people at a party. I went to the party with intent to kill Anna Bui. When I saw her at the party, I fired the rifle intending to kill her; Anna Bui died as a result. I saw Jacob Long and Jordan Ebner, pointed the rifle at them with intent as well to kill them. I fired the rifle at both of them and killed them both.

“Later that night, as I continue shooting people at the party, I shot at three different people whom I later learned were William Kramer, Tristan Bratvold and Alex Levin. I did not know who they were at the time I fired the rifle. I fired the rifle with the purpose to kill whomever I hit. I now know that I hit these three people. I failed to kill them. I did try to kill them though.

“As I am writing this I realize that I did not recognize Jacob Long or Jordan Ebner at the time of firing the rifle; however, I did mean to kill them …”