The gunman who killed 17 students and staff during the 2018 Parkland school shooting has been sentenced to life in prison without the possibility of parole. 

A Florida jury voted last month to spare convicted shooter Nikolas Cruz from the death penalty, instead choosing life in prison without parole. 

Cruz, 24, pleaded guilty last year to carrying out the shooting at Marjory Stoneman Douglas High School on Valentine's Day in 2018. 

The attack was one of the deadliest school shootings in US history, leaving 17 dead, including 14-year-old Irish dancer Cara Loughran, whose father is from County Antrim.

Last month, the jury in Cruz's three-month penalty trial voted 9-3 to sentence the 24-year-old to death, but Florida law requires unanimity for the sentence to be imposed. 

Judge Elizabeth Scherer sentenced Cruz to 17 consecutive life sentences on Wednesday, adding an additional 17 sentences for the people he wounded in the attack. 

Jury foreman Benjamin Thomas told CBS News that one juror opted against the death penalty because she believed Cruz suffered from some form of mental illness. Thomas said the juror's belief may have influenced other jurors to vote against the death penalty. 

Cruz was sentenced just days after families of the 17 victims addressed him over a two-day period in court. 

Anne Ramsey, the mother of 17-year-old Helena Ramsey, told Cruz that he was "pure evil", while Inez Hixon, the daughter-in-law of murdered athletics director Chris Hixon, described him as a "domestic terrorist". 

David Alhadeff, whose niece Alyssa Alhadeff died in the attack, told Cruz that he deserves to "rot" for his crimes. 

"You deserve the opportunity to absorb the look of terror on your face once you leave this courtroom," Alhadeff said. 

"You deserve the opportunity of knowing that justice will prevail at some point, causing you great anguish, minute by minute, day by day." 

Speaking after Cruz's sentencing, Alyssa Alhadeff's mother Lori said she did not understand why Cruz did not receive the death penalty. 

"This should have been the death penalty — 100%," Lori Alhadeff told the Associated Press. 

"I sent my daughter to school, and she was shot eight times. I cannot understand. I just don’t understand." 

An expelled student, Cruz was 19 when he killed 14 students and three staff members with a semi-automatic rifle in February 2018. 

He later apologized for his crimes and asked to be given life without parole instead of the death penalty so that he could dedicate the rest of his life to helping others.