A U.S. Marine has been spared prison time for killing an Iraqi detainee during a battle to recapture the city of Fallujah.

A military judge on Wednesday reduced Sgt. Jermaine's Nelson's rank from sergeant to lance corporal. He ruled out a bad conduct discharge for the 28-year-old New Yorker.

Navy Capt. Keith Allred sentenced Nelson to 150 days in prison but a pretrial agreement ruled out incarceration. Under court-martial rules, Nelson got the less severe punishment. The judge didn't know terms of the agreement until after announcing his sentence.

Nelson pleaded guilty Tuesday to dereliction of duty for killing the detainee in November 2004.

He remains an active Marine, eligible for an honorable discharge or a general discharge under honorable conditions.