These inmates really earned their stripes — for saving a deputy’s life.

Six Polk County jailbirds in Georgia sprang into action when they saw the officer collapse while supervising them on a field detail outside, 11alive.com reported.

“They could have taken the gun, got the work van and gone,” Sheriff Johnny Moats told Time magazine.

“They could have done anything they wanted. They were out there by themselves with this one officer,” he said. “If they would have left him there, it could have been hours before anyone came across him.”

The men — who were all jailed for minor criminal offenses — were cutting grass at a cemetery when the deputy collapsed in 100 percent humidity.

“When he started breathing, it was just real heavy and real fast,” said Greg Williams, who along with his fellow inmates opened the man’s shirt and removed his bulletproof vest to perform CPR.

Meanwhile, one of them called 911 with the officer’s phone.

The Sheriff’s Office applauded the inmates’ quick actions before EMS arrived.

“They really stepped up in a time of crisis and show that they care about my officers,” Moats told 11alive.com. “That really speaks a lot about my officers too, how they treat these inmates. They treat them like people. Like family.”

The officer has recovered and returned to duty. His relatives provided the inmates with lunch and desserts as a show of appreciation.

The Sheriff’s Office mentioned the men’s heroics on its Facebook page just days after the end of a three-day manhunt for two Georgia prisoners who had killed two guards before escaping.

“As we watched the horrific manhunt this week of the two inmates that killed two Correctional Officers and were captured last night we all know that Monday could have ended differently for our Officer,” the department said. “We are very proud of the actions of all 6 inmates involved.”

But Williams downplayed all the hoopla.

“When that happened, in my opinion, it wasn’t about who is in jail and who wasn’t,” he said. “It was about a man going down and we had to help him.”