The $1.3 trillion spending bill signed by President Trump in March does not include a penny for the new border wall the president had promised during his presidential campaign.

And while legislators may have figured that would be the end of it, Trump surprised many people Tuesday by announcing he might deal with the issue in a different way. As he put it, “I spoke with [Defense Secretary James] Mattis. We’re going to do some things militarily. Until we can have a wall and proper security, we’re going to be guarding our border with the military.”

Trump signed a proclamation Wednesday directing the National Guard to be deployed.

The president, in particular, seemed concerned about a caravan of migrants from Central America currently marching through Mexico toward the U.S. “If it reaches our border,” said Trump, “our laws are so weak and pathetic...it’s like we have no border.”

His statements have created a controversy regarding how much power he has in such a situation.

Legally, the debate centers on two federal laws: the Insurrection Act and the Posse Comitatus Act.

The Insurrection Act goes back to 1807, and allows a president to deploy troops anywhere in the U.S. to execute federal law -- generally, to put down lawlessness and insurrection. This power is limited, though it was used as justification for the Civil War.

The Posse Comitatus Act, originally passed in 1878, limits the federal government’s use of the military in domestic issues. It came about in response to the Reconstruction Era following the Civil War, when federal troops had been policing the former states of the Confederacy.

While the president is limited in how he may use federal troops, they have been called out in modern times on domestic issues. Some examples:

-- in 1957, President Dwight D. Eisenhower sent federal troops to Little Rock, Arkansas to support desegregation of schools.

-- in 2005, President George W. Bush sent the National Guard into the Gulf Coast to help with relief efforts after Hurricane Katrina.

Two recent interventions dealt with border issues:

-- from 2006 to 2008, President George W. Bush deployed the National Guard to aid Customs and Border Protection, though troops did not have authority as law enforcement officials and couldn’t detain suspects.

-- in 2010, President Barack Obama sent the National Guard to the border, though with limited powers, mostly to fix infrastructure and work on surveillance.

The kind of military action President Trump is hinting at is considerably bolder, and many legal experts question how much power he has to commit the troops to such activity.

Fox News legal expert Judge Andrew Napolitano, while he personally believes it would be “a horrendous thing for [Trump] to do politically,” believes the president, as commander in chief, would have an argument for deploying troops. As Napolitano puts it: President Trump “could argue this is a matter of national security and Congress won’t act... so he will act.”

While Napolitano doesn’t believe this is the sort of action contemplated by the Insurrection Act, he notes presidents can often get away with activities that are questionable, especially in dealing with a crisis or emergency. “In Katrina, the troops were used for domestic law enforcement and Bush just didn’t care about the Posse Comitatus Act” -- though in that case, with human lives at stake, people seemed willing to look the other way.

There are only limited ways to stop a troop deployment to the border, adds Napolitano.

'I think he can get away with it.' — Judge Andrew Napolitano

Generals can refuse what they believe is an illegal order, but that’s rare. It’s possible the courts could get involved — as they did last year with Trump’s order limiting certain immigration — but Napolitano believes the possibility is slim. First, it could be hard to find a plaintiff with proper standing to try to prevent presidential action, and second, the courts would likely find, in the end, that this is a political question to be determined by Congress and the president.

Then there’s Congress, which could refuse to fund the president’s actions, though they would need a two-thirds vote to override any veto from Trump.

So, all added up, Napolitano says “I think he can get away with it.”

Nevertheless, if the president took strong action with federal troops at the border, there could be tremendous political fallout. So the question is: How far will he go?

Perhaps the president’s talk of sending troops is just Trump being Trump. As Judge Napolitano puts it, “It may well be another example of Donald Trump going to extremes so that a resolution of the issue can be done in a more rational way.”