The eight inmates were locked up in a holding cell at the District Courts Building in Fort Worth city when the incident happened.
The only guard posted next to the cell had been cracking jokes with the inmates when he suddenly collapsed in his chair due to a cardiac arrest, New York Daily News reported.
The prisoners then began shouting for help but no one was there nearby.
The inmates kept screaming for help and started banging on doors in a desperate bid to get someone down to the cell. Deputies upstairs in court heard the ruckus and rushed down, thinking they had a fight on their hands.
Also Read
"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," inmate Nick Kelton told 11 WFAA TV station.
Medics used a defibrillator to shock the guard, and his heart started beating again as the inmates looked on.
Captain Mark Arnett said the prisoners' breakout likely saved the guard's life.
"He could have been there 15 minutes before any other staff walked in and found him," Arnett said.
The cell's locks have been strengthened after the inmates' escape for a good deed, the report added.