Anons should check the Wikipedia article Ex parte Quirin. Excerpt:
The Court ruled that the German saboteurs had no right to be given access to civilian courts because they were "plainly within the ultimate boundaries of the jurisdiction of military tribunals, and were held in good faith for trial by military commission, charged with being enemies who, with the purpose of destroying war materials and utilities, entered or after entry remained in our territory without uniform — an offense against the law of war. Those particular acts constitute an offense against the law of war which the Constitution authorizes to be tried by military commission." It held that while lawful combatants may be captured and held as prisoners of war, unlawful combatants face harsher circumstances such as being sentenced to prison terms or put to death.
The Court also drew a distinction between the cases of Milligan and Quirin. In the Milligan case, Lambdin P. Milligan, although conspiring to commit sabotage in aid of the Confederate cause, was a civilian resident of Indiana, one of the many Union states engaged in a Civil War against the Confederacy, had not had a residence in a Confederate state, was not a part of or associated with the Confederate armed forces, and thus couldn't be tried by a military tribunal in areas where civilian courts were operating. On the other hand, in the Quirin case, the Germans were part of or associated with the German armed forces, entered into U.S. territory without proper uniforms in time of war for the purpose of gathering intelligence or waging war by destruction of life or property, and thus were liable to be tried by a military tribunal.[9][10]
Haupt and Burger argued that as U.S. citizens, they should not have their writs of habeas corpus suspended but the Court ruled that "[c]itizenship in the United States of an enemy belligerent does not relieve him from the consequences of a belligerency which is unlawful because in violation of the law of war."[11] It also stated that "citizens who associate themselves with the military arm of an enemy government, and with its aid, guidance, and direction enter this country bent on hostile acts are enemy belligerents within the meaning of the Hague Convention and the law of war."[12] Furthermore, the Court ruled that the president's proclamation was a lawful order because it was in fact recognized by Congress in Articles 15, 38, and 46 of the Articles of War