HOUSTON, Texas (KTRK) -- A former student is charged with two felonies in connection with Friday's school shooting that injured a principal and sent students and staff fleeing for safety.
Dexter Kelsey, 25, is charged with aggravated assault against a public servant and deadly conduct in connection with the incident.
Kelsey is accused of walking into the school building and opening fire, breaking the glass of the building's doors making his way inside. Eric Espinoza, the school's principal, was shot in the lower back.
Espinoza was attempting to alert teachers and students about the gunman when he was hit, according to Houston police. Kelsey confessed to the shooting, police said.
Espinoza was released from a hospital with non-life threatening injuries and was recovering at home Saturday.
RELATED: Former student in custody after school principal was shot and wounded
"We're just glad that he's doing ok," said a man who identified himself Friday night as Espinoza's father to ABC13.
SEE ALSO: Southwest Secondary student says principal saved them: 'He took a shot for us'
Kelsey once attended the school, according to authorities.
Classes at YES Prep Southwest Secondary will be canceled Monday through Wednesday next week, according to the school.
No students were injured during the incident that caused widespread panic followed by relief for parents.
"When I was coming out, I saw blood and glass shattering everywhere," one 7th grader said. "My teachers told me to stay back in the classroom where nobody can see you and officers came, saying 'Put your hands up. Go outside.'"
YES Prep Southwest said it will meet with students and families before classes resume next week.
"We cannot imagine the terror you must have felt as the events unfolded. [Friday's] shocking incident is one that no student, parent or educator should ever have to go through or cope with on their own. We have counselors standing by to help anyone needing support over the weekend, next week, and through the school year," the school wrote.
YES Prep Southwest Secondary is a charter school that serves students in the 6th through 12th grades. The campus has an enrollment of more than 1,000 students, according to data from the Texas Tribune.
SEE ALSO: TIMELINE: Deadliest school shootings in recent history