If President Trump were to fully deploy the U.S. Army or other active-duty military services against American protesters — if, say, he decides to stay in the White House after losing the election — who would wind up actually running the show?

You might think it would be the Defense Secretary, Mark Esper. But you’d be wrong.

The man with “untold power” to give orders to the generals would be Attorney General William Barr.

That’s according to the editors of Just Security, an “editorially independent online forum” hosted by the New York University (NYU) School of Law.

The active-duty military — Army, Navy, Air and Space Forces and Marines — ordinarily exist only to fight foreign enemies. But they have, on rare occasion, been called in to confront major domestic disturbances.

“Ordinarily, the subordination of the military to the Attorney General serves a valuable purpose,” the Just Security editors write in a new essay. “It reflects the constitutional commitment to civilian oversight of the military, which is especially important when it comes to use of military force against Americans on domestic soil.”

What’s worrying the authors and other “close observers,” they say, are “potential situations” that include the president “invoking emergency powers to put boots on the ground to suppress voting in the November election or to quell mass protests if he disputes the outcome.

The authors say under such extreme conditions, this approach is “by no means failsafe” — and the crux of the matter is the “character” of those whoever winds up leading the military.

“In this hypothetical case, a lot would turn on the character of William Barr … who mobilized and centralized an unprecedented [number] of federal law enforcement personnel to respond to protests in Washington, and who has … sought to minimize the actions taken against those protesters,” the authors say.

There is good reason to be concerned about how Barr would personally exercise the power that could be handed to him in the name of quelling domestic disturbances,” they add.

“The infamous operation to forcibly clear protestors in Lafayette Park to achieve a photo op for Trump was ordered by the Attorney General (who keeps changing his story about the details).”

And that, they write, “does not bode well for our future.”