Attorneys for Nikolas Cruz said Friday he intends to plead guilty to killing 17 people in the 2018 mass shooting at a Parkland, Fla., high school, setting the stage for a trial focusing on whether he will be sentenced to death.

Cruz’s defense lawyer told a Broward County judge in a morning hearing that Cruz would change his plea on all counts in the homicide case against him. The defense team is seeking 17 consecutive life sentences for Cruz, 23. Prosecutors are asking for the death penalty. The formal change of plea from Cruz is expected Wednesday, when his lead attorney in the case returns to the state.

Cruz also pleaded guilty Friday to assaulting a jailer in 2018. Appearing in court in a face mask, glasses and a black sweater, he told Circuit Judge Elizabeth Scherer that he understood the charges and felt competent entering the plea in the case, which is separate from his homicide trial.

He faces a minimum sentence of roughly 14½ months on counts of attempted aggravated battery on a law enforcement officer with a deadly weapon, battery, depriving an officer of means of protection, and attempted use of a self-defense weapon against an officer.

When the judge asked if he had any hesitations, Cruz said, “I think I’m good.”

Scherer accepted the plea and noted to Cruz that prosecutors would use his conviction in the jail assault case as an “aggravating factor” in arguing for a death sentence for the Parkland killings.

Prosecutors said that Cruz was found competent to stand trial as recently as Friday morning. His defense attorney agreed with the assessment, saying, “I have no issue with my client’s competency.”

Trial in the homicide case has loomed since the February 2018 attack at Marjory Stoneman Douglas High School. The shooting left 14 students and three faculty members dead, and touched off a nationwide student-led movement advocating for gun control legislation and greater school safety.

Cruz was soon charged with 17 counts of murder and 17 counts of attempted murder, and his guilt in the massacre has not been questioned. Police say he confessed to carrying it out, and Cruz’s attorneys have also acknowledged his guilt.

There have been 167 mass shootings in the U.S. All but three were committed by men. Some experts are asking: is it time for masculinity to enter the gun debate? (Nicki DeMarco, Erin Patrick O'Connor, Sarah Hashemi/The Washington Post)

But what has long remained uncertain is what sentence he might face. Prosecutors are seeking a death sentence, with the then-state attorney calling it “the type of case the death penalty was designed for.”

Public defenders representing Cruz, meanwhile, have instead argued for a life sentence, offering to have him plead guilty in exchange for prosecutors dropping the death penalty.

His attorney argued that a trial would be agonizing for South Florida, forcing people to relive the carnage of what happened, and then lead to years of appeals.

Prosecutors have rejected this offer, saying they intended to seek a death sentence.

After WSVN 7News in Miami reported Thursday that Cruz intended to plead guilty, the state attorney’s office in Broward County released a statement reiterating that no plea deal had been reached. If Cruz pleads guilty, the statement noted, the case would then move to the penalty phase, which would determine what sentence he might face.

The state attorney’s office declined to comment Friday after the hearing concluded, referring to their previous statement.

He was charged in 2018 with attacking a law enforcement officer about nine months after the Parkland shooting. According to court records, a sergeant with the Broward Sheriff’s Office working as a guard in the main jail when he told Cruz to stop dragging his sandals while walking.

Cruz responded by showing his middle finger to the sergeant and “aggressively rushing” him, hitting him and grabbing his Taser, prosecutors said.

After being charged, Cruz pleaded not guilty on all counts, court records show. Jury selection had begun in that case earlier this month.