Resistance to President Donald Trump’s strong-handed military proposals to counter a caravan of immigrants headed toward the US-Mexico border is coming from a surprising place: the Pentagon.

When the Department of Homeland Security (DHS) requested troops at the border, it asked the military to perform emergency law enforcement functions like crowd control. But the Pentagon rejected that request in late October in part because it felt active-duty troops don’t have the legal authority to arrest individuals on US soil.

That’s not all: DHS also asked the Defense Department if troops could build detention facilities for migrants trying to enter the United States. The military didn’t like that proposal, however, and DHS didn’t include it in its final request to the Pentagon about what it hoped troops would do.

It’s not unusual for different government agencies to discuss how, exactly, they will work together. In this case, DHS and the Pentagon negotiated what kind of support the military will provide at the border and came to an agreement.

That’s why it’s so striking that Trump continues to say the military will take actions it likely won’t.

For example, here’s Trump on what US troops should do if migrants happen to throw rocks at them. “Consider it a rifle,” he said last Thursday. “When they throw rocks like they did at the Mexico military police, consider it a rifle.”

According to official documents obtained by the Washington Post, troops are allowed to use deadly force to protect “all persons, foreign or domestic, who are faced with imminent threat of death or serious bodily harm, and where lesser means have failed or cannot be reasonably employed.”

However, the military teaches troops to respond proportionally when possible. And shooting someone over throwing a rock is definitely not proportional.

Trump walked back his comments hours after making them.

He also talked about building “massive tent cities” to house individuals seeking asylum in America. But the military declined to do that too, and it’s now unclear who — if anyone — will do it.

Asked for comment, Lt. Col. Mike Andrews, a Pentagon spokesperson, told me, “The Department of Defense does not discuss internal deliberations.” A DHS official said “DHS and DOD are working closely together to advance the president’s border security mission” and that the government will continue “looking at locations and available avenues if the need for additional housing arises.”

Experts, though, say the Pentagon’s resistance to the requests makes sense. “The military doesn’t want to take aggressive actions because of all the legal restrictions ... they don’t want to bump up against that,” Timothy Dunn, an expert on border law enforcement at Salisbury University, told me.

What the military can legally do at the border

US troops can’t detain, arrest, or search anyone at the border. That’s a law enforcement function, and the military can’t perform those duties on US soil unless there’s no other way to enforce the law, William Banks, an expert on the military’s domestic authorities at Syracuse University, told me.

However, the military has been used for law enforcement needs in dire situations, such as during the 1992 Rodney King riots in Los Angeles. Then-President George H.W. Bush invoked the Insurrection Act to enforce the law because he deemed it impossible for other law enforcement to do so.

But the roughly 7,000 troops at the border now can only improve walls and infrastructure, work in offices, transport border officials in aircraft, and offer medical help — little more. They shouldn’t have any interactions with individuals at the border unless absolutely necessary.

That, in part, led Banks to say the use of active-duty troops to defend against the caravan was unlawful on its own. “If we were attacked by Mexico, we’d be there lawfully,” he told me, “but there’s no justification for it here.”

It’s therefore possible the military pushed back on DHS’s two requests on solely legal grounds. But Dunn said it’s also possible the Pentagon just doesn’t want to involve itself too much in a mission it may not care for.

“The military historically has never really been enthusiastic about doing border policing,” he told me. “They have much bigger fish to fry.”