An American soldier who refused to deploy to Afghanistan over his beliefs that the war violates international law was sentenced Wednesday to a month in jail.

Spc. Victor Agosto, 24, pleaded guilty to disobeying a lawful order to report to a site that performs medical, legal and other services for troops before they deploy. The judge also reduced his rank to the Army's lowest level, a private, which also was part of the maximum penalty he faced in his plea agreement with the military.

Agosto said that when he enlisted in 2005, he felt invading Iraq was wrong but that troops had a mission to complete. He said he began to oppose the wars in Iraq and Afghanistan after he served a 13-month tour in Iraq, which ended in late 2007.

After the sentence was announced, Agosto immediately ripped the rank patch from his uniform. He later was escorted out of the building and taken to the county jail, where he will start serving his sentence.

Also, Agosto cannot be discharged at a level lower than other-than-honorable conditions, an administrative discharge. A discharge was not mentioned in the hearing, but Agosto is expected to be released from the Army after completing his jail term.

Before he was sentenced during the hourlong military hearing at the central Texas Army post, he told the judge he should not be jailed because he posed no threat to anyone.

He said he had remained on post and went to work every day since refusing to deploy after learning a few months ago that the Army was keeping him beyond his enlistment date. He said he did not use drugs or go absent without leave, as other soldiers have done to avoid deployment.

He said he did not apply for conscientious objector status because that requires opposition to all wars, and he does not believe that all war is wrong.

"I really had no Army way of being consistent with my conscience," Agosto said. "The courts haven't recognized soldiers' rights to refuse an order they believe to be illegal. ... I believe future courts will find that the Afghanistan war is illegal because it violates international law."