Updated

Nikolas Cruz pleaded guilty to murder on Wednesday in the 2018 high school massacre in Parkland, Florida, that left 17 dead.

After entering his plea, he briefly removed his mask to address the judge, stressing that though contrary to Florida, he believes the victims and their families should have the right to decide whether prosecutors should pursue the death penalty or a life sentence. 

"I am very sorry for what I did and I have to live with it every day. And if I were to get a second chance, I would do everything in my power to try to help others," Cruz said. "I am doing this for you and I do not care if you do not believe me, and I love you, and I know you don’t believe me but I have to live with this every day and it brings me nightmares and I can’t live with myself sometimes, but I try to push through because I know that’s what you would want me to do."

NIKOLAS CRUZ, GUNMAN IN PARKLAND, FLORIDA, SCHOOL SHOOTING TO PLEAD GUILTY 

Cruz, 23, entered his plea in a courtroom attended by a dozen relatives of victims after answering a long list of questions from Circuit Judge Elizabeth Scherer aimed at confirming his mental competency. He was charged with 17 counts of murder and 17 counts of attempted first-degree murder for those wounded in the Feb. 14, 2018, attack at Marjory Stoneman Douglas High School in Parkland, located just outside Fort Lauderdale.

Several parents and other relatives of victims broke down in tears while listening to the court proceedings via a Zoom call.

"I hate drugs, and I believe this country would do better if everyone would stop smoking marijuana and doing all these drugs and causing racism and violence out in the streets. I’m sorry, and I can’t even watch TV anymore," Cruz continued in his address to the court. "I just want you to know that I’m really sorry, and I hope you give me a chance to try to help others. I believe it’s your decision to decide where I go – whether I live or die. Not the jury’s. I believe it’s your decision. I’m sorry."

A penalty trial will determine if Cruz will receive a sentence of death or life in prison without parole. Scherer plans to begin screening jurors next month in hopes testimony can begin in January. His attorneys announced his intention to plead guilty during a hearing last week.

Fred Guttenberg, whose 14-year-old daughter Jaime died in the shooting, said he visited her grave this week to ask her for the strength to get through Wednesday's hearing.

"She was the toughest, wisest person I ever knew," he told The Associated Press. "My daughter always fought for what was right. My daughter despised bullies and would put herself in the middle of someone being bullied to make it stop."

The guilty pleas will set the stage for a penalty trial in which 12 jurors will determine whether Cruz should be sentenced to death or life in prison without parole. Given the case's notoriety, Scherer plans to screen thousands of prospective jurors. Hearings are scheduled throughout November and December, with a goal to start testimony in January.

Cruz killed the 14 students and three staff members on Valentine’s Day 2018 during a seven-minute rampage through a three-story building at Stoneman Douglas, investigators said. They said he shot victims in the hallways and in classrooms with an AR-15 semiautomatic rifle. Cruz had been expelled from Stoneman Douglas a year earlier after a history of threatening, frightening, unusual and sometimes violent behavior that dated back to preschool.

The shootings caused some Stoneman Douglas students to launch the March for Our Lives movement, which pushes for stronger gun restrictions nationally. 

The guilty pleas come a day after the families of the victims of the shooting reached a $25 million settlement with the Broward County school district, The Hill reported. 

"There isn’t enough money in existence that would compensate the victims and their families adequately," David Brill, who represents the parents of four students who were killed and a fifth student who was wounded, said in a statement. "But this settlement provides a measure of justice and accountability to them and the other families and victims."

Since days after the shooting, Cruz's attorneys had offered to have him plead guilty in exchange for a life sentence, saying that would spare the community the emotional turmoil of reliving the attack at trial. But longtime Broward State Attorney Mike Satz rejected the offer, saying Cruz deserved a death sentence and appointed himself lead prosecutor. Satz, 79, stepped down as state attorney in January after 44 years but remains Cruz’s chief prosecutor.

CLICK HERE TO GET THE FOX NEWS APP

His successor, Harold Pryor, is opposed to the death penalty but has said he will follow the law. Like Satz, he never accepted the defense offer — as an elected official that would have been difficult, even in liberal Broward County, where Democrats outnumber Republicans by more than 2 to 1.

By having Cruz plead guilty, his attorneys will be able to argue during the penalty hearing that he took responsibility for his actions.

The Associated Press contributed to this report.