President Trump has the legal authority to deploy active-duty military personnel to states to help quell violent protests across the country over the death of a black man in police custody — though the dramatic move he threatened Monday would probably generate strong pushback from some state and local officials, analysts said.

In a televised speech, Trump said he had recommended Monday “to every governor to deploy the National Guard in sufficient numbers that we dominate the streets.”

“Mayors and governors must establish an overwhelming law enforcement presence until the violence has been quelled,” Trump said. “If a city or a state refuses to take the actions that are necessary to defend the life and property of their residents, then I will deploy the United States military and quickly solve the problem for them.”

Moments before he spoke, police fired flash-bang shells that exploded in the middle of a crowd of protesters outside Lafayette Square, just outside the White House, and then mounted police forced protesters away from the park.

Many states already have mobilized the National Guard to help respond to violent protests across the country over the death of George Floyd, whose finals gasps of “I can’t breathe” in Minneapolis were caught on video. The federal government has also initiated a dramatic response from federal law enforcement.

That is especially true in the District. Justice Department spokeswoman Kerri Kupec said Monday evening that all of the department’s components — including the FBI, ATF, Drug Enforcement Administration, U.S. Marshals and Bureau of Prisons — had been deployed to “assist in the restoration of order” there. Attorney General William P. Barr was personally traveling around the city and observing the scene.

The deployment of active-duty military personnel, though — particularly to states that may not want them — would represent a further escalation of Trump wielding his considerable presidential powers.

“I am mobilizing all available federal resources, civilian and military, to stop the rioting and looting, to end the destruction and arson, and to protect the rights of law-abiding Americans,” Trump said.

A law called the Posse Comitatus Act prohibits the domestic use of military for law enforcement purposes without specific congressional authorization, said Stephen Vladeck, a professor at the University of Texas Law School. But a different law, the Insurrection Act, provides the president authorization to do so under certain circumstances, he said.

According to a Congressional Research Service report, the act has been invoked “on dozens of occasions” throughout U.S. history, though its recent use has been “exceedingly rare.” The act was invoked in 1992 during riots in California over the beating of motorist Rodney King, though in that instance, the state’s governor requested it.

It was also used during the civil rights movement, including when President Dwight D. Eisenhower sent the Army into Little Rock to desegregate its schools, Vladeck said. The law says the president can intervene if state authorities are unable to give their residents the protection of law.

“I think there’s a reason why the statute allows him to act even if states don’t ask him,” Vladeck said. “I don’t think the situation is as dire as the drafters of the statute might have contemplated, but invocation of the Insurrection Act here seems much less controversial to me as a legal argument than many of Trump’s other actions.”

Gary Solis, retired law professor at the U.S. Military Academy at West Point and a retired Marine judge advocate, said the act, “does give the executive extraordinarily broad power to assemble federal troops to restore order in the various states.” But, he said, if Trump were to invoke it now, state and local officials likely “would fight tooth and nail to keep federal troops out.”

Former vice president Joe Biden, the presumptive 2020 Democratic nominee for president, said on Twitter, “He’s using the American military against the American people.” Sen. Kamala D. Harris (D-Calif.) echoed those sentiments on CNN.

“He is not a commander in chief,” she said. “He is a divider. He is clearly scared. And he cannot meet this moment that he has partly created because of his inability to understand the pain and the suffering.”

Rebecca Tan and Tom Jackman contributed to this report.