LAWRENCEVILLE, Ga. — A Georgia sheriff's office is thanking a group of inmates credited with rescuing a deputy who collapsed and suffered a head injury while supervising a jail housing unit.

The Gwinnett County deputy was patrolling the unit when the inmates noticed he did not appear to be feeling well, according to an account the sheriff's office posted to social media Tuesday.

The inmates "kept an eye on him" as he returned to the deputy desk before witnessing him lose consciousness and hit the concrete floor, splitting his head open, according to the post.

A group of inmates then began pounding on their housing unit doors and shouting the deputy's name to try and wake him, the office said.

"The entire unit was thundering with noise," the statement said.

The sounds woke the deputy, who managed to get up and open the cell doors before collapsing again. Three inmates rushed to help the heavily bleeding deputy and use his radio to call for aid.

"We are deeply appreciative to these three inmates for the courage, determination and kindness they displayed when they came to the rescue of our deputy," the sheriff's office said, adding: "They didn't hesitate."

The deputy survived and was recovering at home Tuesday, officials said.