It was a sight so incongruous, seeing was indeed believing.
Thirty-three inmates at Lerdo Jail, dressed in orange jumpsuits, stood at military attention as the Stars and Stripes were carried past by a Kern County sheriff's honor guard.
"Pre-sent arms!" barked Miguel Mora, the prisoners' "platoon leader," who was similarly dressed.
Instantly, 33 hands snapped upward in crisp salute of the nation's colors.
Despite the metal fencing, despite the armed guards and the miles of razor wire, for an instant Thursday morning it seemed the jailed convicts, veterans all, were once again proud soldiers, sailors, Marines and airmen.
"We want to help them to not come back here," said Sheriff Donny Youngblood, who was joined at the event by dozens of deputies, jail staff, veteran advocates and the 33 prisoners who were separated from the ceremony by a tall chain-link fence topped with barbed wire.
It's all part of the Incarcerated Veterans Program, an innovative new effort unveiled Thursday designed to identify inmates who have served honorably in the armed forces and assist them with their rehabilitation.
While still in its infancy, the program already includes support for those suffering from Post-Traumatic Stress Disorder, or PTSD. Other mental health resources are being brought to bear as well, and incarcerated vets are learning about resources they may not have been aware of on the outside.
Sheriff's Lt. Kevin Wright noted that the event was also organized to dedicate the placement of a flag pole and a veterans memorial built by inmates at the site.
The National Anthem was sung by sheriff's Sgt. Misty Billington and musician Brent Williams played the bugle call "To the Color" as the flag was raised into the cool wind.
Youngblood and Wright emphasized that the inmates were behind bars for a reason. No excuses were going to be made for them on that score.
But as a veteran of the Vietnam War, Youngblood said he is saddened that so many military veterans, men not so different from those with whom he fought and served, are behind bars.
"There's a reason they are here," he said. "But they shouldn't be forgotten."
The effort comes on the heels of the Veterans Justice Program, an effort born in Kern County Superior Court a few years ago with the goal of identifying vets facing charges in the criminal justice system.
"It feels really good. It makes me proud," Mora, the platoon leader, said of efforts to consider inmates' military service when deciding their fate.
Sentenced to one year in county lockup for driving drunk and causing injury to another, Mora, 25, said he had never been in serious trouble before.
The youngest vet in the program, Mora served in the Navy from 2007 to 2011. He carried caskets at Arlington National Cemetery and participated in ceremonies held at the White House.
He can hardly believe members of local law enforcement want to help men like him find their way back to a successful life as a productive member of the community.
"We have a new counseling group for PTSD," he said. Before the new program, an inmate might have waited two months to see a counselor.
With more than 100 veterans now incarcerated at Lerdo, and thousands who have passed through the system in recent years, veterans advocates hope programs like the one at Lerdo may give many a second chance.
"I think it's important to remember that they are, in fact, veterans," said Dick Taylor, the head of Kern County's veterans services and a military veteran.
And that has to mean something.