The Constitution doesn’t mention the words martial law, and it was generally assumed to be a power of the President in the early republic. Lincoln declared martial law during the Civil War.
After the war, however, in Ex parte Milligan, 71 U.S. 2 (1866), the Supreme Court granted Milligan a writ of habeas corpus saying that:
In 1878, Congress passed the Posse Comitatus Act:
No President since has declared martial law. If one tried to seize Congress and the Courts with the help of the military it would be a coup, not a legal act. That’s such a totally hypothetical situation that nothing meaningful could be said about it today.
The Gun Owners of America, whoever they might be, have a problem with the government and dislike the idea of the feds using the military against civilians. They’ve put together a remarkably comprehensive and admittedly straightforward and even-handed discussion of all the instances of martial law and government use of soldiers against civilians here. It’s well worth reading.