KTRK (SANTA FE, Texas) — The officer who was injured when he confronted a shooter at a Texas high school last month has been released from the hospital after nearly three weeks.

When a 17-year-old student allegedly opened fire at the school on May 18, Santa Fe Independent School District police officer John Barnes was wounded and taken to The University of Texas Medical Branch in Galveston in critical condition.

Barnes, a husband and father, “would drop everything and go in there,” Houston Police Captain Jimmy Dale told ABC News shortly after the shooting.

“And he knew with an active shooter, to eliminate the threat, any second you waste is a life lost and he wasn’t going to let that happen,” Dale said.

Houston Police Chief Art Acevedo said he visited Barnes in the hospital on Monday.

“Although the road to recovery will be long and hard, he is in great spirits and looked great,” Acevedo wrote on Twitter.

The suspected shooter, Dimitrios Pagourtzis, allegedly killed 10 students and staff and injured 13 others inside the school before he was taken into custody. He was charged with capital murder.

Copyright © 2018, ABC Radio. All rights reserved.