A Florida man has pleaded guilty to murdering 17 people in a 2018 mass shooting at a high school campus in Parkland, Florida.

Nikolas Cruz, 23, also pleaded guilty to 17 counts of attempted murder for those he injured in the attack on Marjory Stoneman Douglas High School.

He faces the possibility of the death penalty or life in prison.

One of the deadliest school shootings in US history, the incident became a rallying cry for gun control activists.

Mr Cruz was 19-years-old when he shot dead 14 students and three employees with an AR-15 rifle at his former school. Another 17 people were wounded.

In court on Wednesday, Judge Elizabeth Scherer asked Mr Cruz how he pleaded to each murder.

The case will now head to a penalty trial in which jurors must determine whether Mr Cruz is spared the death penalty to face life without parole.

Judge Scherer has said she hopes that the case – for which thousands of jurors will have to be screened – can begin in January.

Lawyers representing Mr Cruz had repeatedly said that he would plead guilty if the death penalty was not considered. Last week, his attorney, David Wheeler, told the judge that Mr Cruz’s lawyers were asking the court to impose 17 consecutive life sentences for the massacre.

The offer had been rejected by prosecutors, who in earlier court documents said they would seek his execution and prove that the crime “was especially heinous, atrocious or cruel”.

Last week, Mr Cruz pleaded guilty to a separate charge of attempted aggravated battery and three other felony charges stemming from an attack on a jail guard nine months after the shooting.

In a hearing on Friday, he acknowledged that his conviction in the jailhouse assault could become an “aggravating factor” in determining whether he will be executed.

Nikolas Cruz: Parkland gunman pleads guilty to murdering 17
Nikolas Cruz was 19-years-old when he attacked the school

Mr Cruz had been expelled from the school in 2017. Students and staff later described him as an “outcast” and troublemaker.

He had previously been investigated by local police and the Department of Children and Family Services after posting evidence of self-harm on the Snapchat app.

The Federal Bureau of Investigation (FBI) later admitted it did not properly follow up on a tip-off about Mr Cruz the month before the shooting.

Many of the shooting’s survivors went on to become prominent advocates for gun legislation reform and have demanded that action be taken to prevent similar incidents.

In an event marking the third anniversary of the shooting in February, US President Joe Biden called for Congress to pass gun law reforms, including a ban on assault weapons and an end to legal immunity for gun manufacturers.

“We owe it to all those we’ve lost and to all those left behind to grieve to make a change,” Mr Biden said. “The time to act is now.”

NULL Invalid API key or channelobject(stdClass)#8461 (1) { ["error"]=> object(stdClass)#8317 (3) { ["code"]=> int(403) ["message"]=> string(117) "The request cannot be completed because you have exceeded your quota." ["errors"]=> array(1) { [0]=> object(stdClass)#8432 (3) { ["message"]=> string(117) "The request cannot be completed because you have exceeded your quota." ["domain"]=> string(13) "youtube.quota" ["reason"]=> string(13) "quotaExceeded" } } } }