A U.S. soldier charged with deserting his unit in Iraq walked away from the war partly to avoid orders to abuse Iraqi prisoners, his attorneys argued Wednesday.

Attorneys for Staff Sgt. Camilo Mejia (search), an infantrymen with the Florida National Guard (search), spent the first day of his court-martial asking a military judge to allow witnesses to testify in support of Mejia's claim that his unit was ordered to abuse Iraqi detainees.

The judge, Col. Gary Smith, ruled that evidence on the "legality and morality" of prisoner treatment in Iraq was irrelevant to the desertion charge (search) that Mejia shirked his duty by leaving the Army for five months.

Ramsey Clark, one of Mejia's lawyers, said Mejia's unit was ordered to use sleep-deprivation tactics with blindfolded Iraqi detainees, in at least one instance by cocking a pistol next to their heads.

Clark, U.S. attorney general under President Johnson and an outspoken opponent of the Iraq war, said Mejia was protected by international law in avoiding duties that would have constituted war crimes. He compared Mejia's claims of prisoner mistreatment to the abuse scandal at the Abu Ghraib prison (search) in Iraq.

"The United States is seeking to court-martial soldiers in [Iraq] for outrageous abuses at the same time it prosecutes a soldier halfway around the world because he did what he had a duty to do under international law," Clark said.

The judge ruled that only Mejia himself could raise the abuse issue before a military jury of officers and enlisted men that will begin hearing the case Thursday.

Mejia, 28, is charged with desertion after failing to return to his unit in Iraq after a two-week furlough in October. He turned himself in to the Army in March after being gone five months, saying he did not want to fight in an "oil-driven war."

Mejia faces a year in prison and a bad-conduct discharge if convicted of desertion. Military law defines desertion as leaving the military with no intention to return or to "avoid hazardous duty or to shirk important service."

"I can only say, whatever I did, I did because I felt like I had an obligation -- moral and in some cases legal," Mejia told reporters outside the courtroom.

Capt. A.J. Balbo, the lead prosecutor, argued that even if Mejia saw prisoners abused in Iraq that would not justify fleeing the Army for five months.

"This is about a soldier who deserted, who ran away," Balbo said. "While he went into hiding, he never raised these issues. Instead, he buried them in his conscientious objector packet."

After returning in March to Fort Stewart, Mejia applied to become a conscientious objector, saying his experiences in Iraq had made him opposed to war.

While he said publicly that he became upset after seeing Iraqi civilians hit by gunfire during an ambush on his unit, he never mentioned witnessing abuse of Iraqi detainees. He instead described those allegations in his objector application, filed March 16.

The judge also refused to dismiss the charge after Mejia's attorneys argued the Army illegally extended Mejia's service. His enlistment was originally set to end in March 2003, but he was ordered to stay after his unit was called up for the war.

Defense attorney Louis Font said Mejia should have been exempt because a 19th-century treaty between the United States and Costa Rica exempts Costa Rican citizens from "compulsory service" in the U.S. military. He said Mejia is a citizen of Costa Rica, not the United States.

But the judge ruled Mejia did not serve against his will, saying he "voluntarily enlisted and re-enlisted and received pay and benefits from the Army."

Mejia's objector application claims he saw Iraqi prisoners treated "with great cruelty" when he was put in charge of processing detainees last May at al-Assad, an Iraqi air base occupied by U.S. forces.

Ordered to keep prisoners awake for up to 48 hours, soldiers would sometimes bang on walls with a sledgehammer, Mejia wrote, or would "load a 9 mm pistol next to their ear."