Dexter Kelsey, 25, is charged with aggravated assault against a public servant and deadly conduct in connection with the incident.
While Kelsey did not appear due to medical reasons, a judge in probable cause court set bond on the aggravated assault charge at $5 million and $250,000 for the deadly conduct charge.
Kelsey is accused of walking into the school building and opening fire, breaking the glass of the building's doors and making his way inside. Eric Espinoza, the school's principal, was shot in the lower back.
Kelsey went online to buy the rifle used in the shooting, according to prosecutors, and that he had a grudge against a teacher working at the school and was targeting them.
He remained in custody Sunday morning.
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.
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'
Classes at YES Prep Southwest Secondary will be canceled Monday through Wednesday next week, according to the school.
SEE ALSO: TIMELINE: Deadliest school shootings in recent history