July 9, 2016 11:57 AM EDT

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.

More Must-Read Stories From TIME

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

Read More From TIME
Related Stories