Nikolas Cruz has been formally charged with carrying out a massacre at Marjory Stoneman Douglas High School in Florida.

An indictment handed down by a Broward County grand jury charged Mr Cruz with 17 counts of premeditated murder and 17 counts of attempted murder. It means Mr Cruz may face the death penalty if he is convicted.

A former student who had been expelled from the Parkland high school, Mr Cruz is accused of killing 14 students and three school employees during a rampage last month.

Prosecutors have not yet announced whether they plan to seek the death penalty, but Mr Cruz’s public defender has said his client would be willing to plead guilty to avoid execution.

Mr Cruz confessed to carrying out the shooting when he was apprehended shortly afterward, according to an arrest affidavit.

The suspected shooter’s lawyers have described him as a troubled and “broken” young man and have argued the system failed him, noting that his behaviour repeatedly drew the attention of authorities.

Florida shooting – in pictures Show all 10 1 /10 Florida shooting – in pictures Florida shooting – in pictures Police arrest a suspect in connection with the shooting at the Marjory Stoneman Douglas High School in Parkland, Florida Reuters Florida shooting – in pictures Parents wait for news after reports of a shooting at Marjory Stoneman Douglas High School in Parkland, Florida AP Florida shooting – in pictures Anxious family members wait for news of students AP Photo/Wilfredo Lee Florida shooting – in pictures Students being evacuated from the school AP Florida shooting – in pictures Students being evacuated from the school Getty Florida shooting – in pictures People gather waiting for word from students AP Florida shooting – in pictures Parents waiting for news on their children AP Florida shooting – in pictures People gather at a hotel where students were taken after the shooting Getty Florida shooting – in pictures Florida Governor Rick Scott speaks to the media as he visits Marjory Stoneman Douglas High School following the shooting AFP/Getty Florida shooting – in pictures Dr. Igor Nichiporenko, Medical Director Trauma, left, and Dr. Evan Boyer, Medical Director, Emergency Services, speak about treating victims and the suspect at a press conference outside Broward Health North hospital AP

Jail records released by the Broward County Sheriff’s Office describe Mr Cruz, segregated from other inmates, as at times appearing “logical and coherent” and in other instances exhibiting a “blank stare”. He has shown signs of restlessness and been heard laughing, the records say.

On the same day the grand jury handed down its indictment, Secretary of Education Betsy DeVos visited Marjory Stoneman Douglas High School. Her appearance frustrated some students who said said they were not able to air their concerns.

Betsy DeVos says guns can be used in schools because of grizzly bears