A group of inmates at a Texas jail broke out of a holding cell last month to save a guard who had suffered an apparent heart attack.

The guard had been joking with the inmates—who were locked in a small room in the basement of the District Courts Building in Weatherford, Texas—when he suddenly slumped over, according to local station WFAA-TV.

“He just fell over,” inmate Nick Kelton said. “Looked like an act. Could have died right there.”

Kelton and the other inmates shouted for help and then managed to break out of the cell, knowing it could have put them in a dangerous situation.

“We were worried they’re going to come with guns drawn on us,” Kelton said, WFAA-TV reported. Other deputies eventually came running when they heard shouting from the inmates, who had noticed the guard didn’t have a pulse. The guard, who has not been identified, regained a pulse after receiving medical aid from the deputies and paramedics.

“It never crossed my mind not to help whether he’s got a gun or a badge. If he falls down, I’m gonna help him,” Kelton said. “He’s a good man.”

Capt. Mark Arnett said the inmates likely saved the guard’s life because it could have been a while before someone else walked by and found him, WFAA-TV reported. The incident happened on June 23 and was reported by news outlets this week.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Katie Reilly at Katie.Reilly@time.com.