Congress ammended the rules of war after the war of 1812 to include U.S. Citizens.
During the Civil War people were held until the end of the war without trial. Read all of the Supreme Court decision of 1942. They explain all this.
EX PARTE QUIRIN, 317 U.S. 1 (1942)