A 16-year-old pleaded guilty Wednesday to two charges of murder for fatally shooting his father in their home and a 6-year-old boy at the South Carolina elementary school he once attended.

Jesse Osborne faces 30 years to life in prison without parole when he is sentenced several months from now in an extensive hearing in Anderson County that will take into account his age, his chance for rehabilitation and the circumstances of the crime.

Solicitor David Wagner said he thinks Osborne should die in prison. He detailed in court how the teen spent weeks planning the shooting at Townville Elementary School and days discussing it in a secret Instagram group that Wagner described as a "sleeper cell of would-be school shooters."

Osborne told the group, "I think I'll probably most likely kill around 50 or 60," then followed up with a message saying, "If I get lucky maybe 150," according to the messages retrieved by investigators.

Osborne said he first considered shooting students at the middle school he was suspended from after he had shown up there with a hatchet and a machete.

"The middle school has tons of cops," he said in the chat group six days before the shooting. "The elementary school doesn't."

Osborne detailed how he wanted to shoot his way through a window and into a classroom at the elementary school, kill the students and the teacher and then throw pipe bombs into other classes, according to the messages.

Osborne's lawyer said the sentencing hearing would be the time to argue about the messages, not Wednesday's plea hearing. During a previous hearing that resulted in a judge deciding Osborne could be tried as an adult, his lawyers argued the youth was angry because he was bullied and because his father would get drunk and belittle and try to fight Osborne and his mother.

"He and I talk about a lot of things. But he is still a kid," Osborne's lawyer Frank Eppes said outside the courtroom Wednesday.

Jesse Osborne shot his 47-year-old father, Jeffrey Osborne, three times in the back of the head as he sat in a chair reading on Sept. 28, 2016, in part because he needed his dad's pickup truck to drive to the school, Wagner said.

In his confession, Jesse Osborne said he kissed his bunny Floppy and other pets goodbye and called his grandmother before driving the 3 miles (5 kilometers) to Townville Elementary School.

Osborne crashed the truck into a playground fence and fired several shots at a group of students outside for recess. Six-year-old Jacob Hall was shot in the leg and died three days later from blood loss.

Witnesses said Osborne threw down the gun and was crying, "I'm sorry! I'm sorry!" as a volunteer firefighter held him down while waiting for police.

Osborne said he loaded the wrong type of ammunition in the gun and it jammed after every shot at the school. Teachers outside with their first-graders said he never tried to enter the school as the children rushed inside.

"It jammed again every time, and I thank God for that," Osborne said in his videotaped confession hours after the shooting. "Please say no one died. Did anyone die?"

Detectives didn't answer.

Osborne also pleaded guilty to three counts of attempted murder. Two students and a teacher were wounded but survived.

The teen, dressed in a sweater vest and a button-down shirt, said little in court Wednesday. When Circuit Judge Lawton McIntosh asked him if he understood his guilty plea might mean he would die in prison, he simply answered, "Yes, sir."

Several people at the school were in the courtroom, but Wagner said they wouldn't testify until the sentencing hearing.

Townville Elementary School is still traumatized after the shooting and Jacob Hall's funeral, where people dressed as their favorite superheroes. The principal said earlier this year that the sound of a balloon popping at the school sent children into a panic.

The South Carolina Supreme Court set guidelines on life sentences for juveniles after the U.S. Supreme Court ruled in 2012 that juveniles could only be kept in prison for the rest of their lives in the most extreme cases.

___

Follow Jeffrey Collins on Twitter at https://twitter.com/JSCollinsAP. Read his work at https://apnews.com/search/jeffrey%20collins

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.