MINEVILLE, N.Y.—At 5:30 on a misty morning in the Adirondacks, 180 prisoners leapt out of bed when a bugle call blasted over a loudspeaker.

Fifteen minutes later, they were performing synchronized exercises while a drill instructor barked orders.

“Motivated! Motivated! Motivated, sir!” the men shouted in unison between calisthenics.

These inmates are serving six-month sentences at Moriah Shock Incarceration Correctional Facility, one of the last prisons in the U.S. that seek to “shock” inmates out of criminal behavior through a military-style boot camp. Inmates at the facility typically trade multiyear sentences for six-month stints.

Such programs used to be widespread, but fell out of favor in much of the country amid debate about their effectiveness. Only a handful remain and two of them are in New York, where correction officials say their brand of military-style training reduces recidivism and saves taxpayer money through shorter sentences.