(CNN) Two men from Montana have been sentenced to prison for violating the terms of their probation. However, neither will be eligible for parole until they fulfill the unique set of conditions set forth by a judge after they falsely claimed to have served in the military.

One of the requirements involves handwriting the names of 6,756 Americans who were killed in the Iraq and Afghanistan wars.

Troy Allan Nelson, 33, and Ryan Patrick Morris, 28, were charged in separate crimes on Friday by Judge Greg Pinski in Cascade County District court in Great Falls, Montana.

Troy Allan Nelson

According to court documents, Morris was on probation for felony burglary after he stole items valued at less than $1,500 from his landlord's garage. Morris was given 10 years in prison for violating the terms of his probation. He also falsely claimed to have served in the military, which made him a target of Judge Pinski.

Nelson, meanwhile, received five years for criminal possession of dangerous drugs, which is a felony. He was enrolled in Veterans Treatment Court before his deception was eventually discovered.

Read More