In a show of courage and compassion, several inmates in Texas broke out of their holding cell to help a guard who had suffered a heart attack.

The feat, which was captured by security cameras, was a risky move for the inmates.

“We were worried they’re going to come with guns drawn on us,” inmate Nick Kelton told WFAA, a local TV station.

Kelton and other inmates who were being held temporarily in the basement of a court building in Weatherford, Texas, on June 23 saw the jailer on duty—who hasn’t been named—fall slack in his chair. The inmates sprang into action, breaking down the door to their cell in order to help the guard. Since they were shackled, the men started banging on doors and walls until other guards upstairs heard the noise and rushed down to help.

Medics were able to revive the guard, and he is expected to return to work next week.