Three Gwinnett County jail inmates are being praised for their efforts to help a deputy who recently suffered a medical emergency outside their cells.

The inmates, Terry Loveless, Walter Whitehead and Mitchell Smalls, noticed a deputy who wasn’t feeling well while working, the Gwinnett sheriff’s office posted on social media.

“Although they were locked in their cells, they kept an eye on him as he returned to his seat at the deputy desk, where he lost consciousness and fell onto the concrete floor, splitting his head open,” the sheriff’s office said.

The inmates began pounding on their door, and others did the same thing. The noise helped arouse the injured deputy.

“Our deputy later stated that while he did not realize he’d been unconscious, he became aware of what sounded like pounding drums and could hear inmates shouting his name over and over,” the sheriff’s office said. “He immediately thought an inmate needed help and somehow managed to rise to his feet and press the control panel to open cell doors.”

The three inmates left their cells to help the deputy, who again lost consciousness and used his phone and radio to call for help. The deputy survived the incident and is recovering at home, the sheriff’s office said.

“These inmates came to his aid because our deputy, like most law enforcement officers, treats people with the dignity they deserve,” the sheriff’s office said. “These inmates had no obligation whatsoever to render aid to a bleeding, vulnerable deputy, but they didn’t hesitate. Many people have strong opinions about law enforcement officers and criminals, but this incident clearly illustrates the potential goodness found in both.”

According to jail records, Whitehead is being held without bond on drug trafficking and possession charges. Loveless was charged with trafficking methamphetamine in 2017 and is being held without bond. Smalls is also being held without bond on a drug charge, probation violation and family violence, records show.