Of course, in Milligan, the Court said:
Suspension of the privilege of the writ of habeas corpus does not suspend the writ itself. The writ issues as a matter of course; and, on its return, the court decides whether the applicant is denied the right of proceeding any further.
Preposterous! As Farber notes (pg 165), "Justice Davis touched upon some of those legitimate war powers, noen of which he found applicable [to Milligan's case]. First, men "wicked enough to counsel their fellow citizens to resist the measures" of the government in wartime may be arrested and detained without habeas corpus. But this power of detention did not include the power to try and punish the detainees. Second, if in "foreign invasion or civil war, the courts are actually closed, and it is impossible to adminster criminal justice according to the law," martial law applies "on the theater of active military operations, where war really prevails." But martial law cannot exist "where the courts are open, and in the proper and unobstructed exercise of their jurisdiction." Martial law is "also confined to the locality of actual war."
In Milligan the Court ruled martial law did not apply in Indiana. They left open the question as to where and when it did apply. Notably, the Court also upheld the terms and validity of the Habeas Corpus Act.