WASHINGTON - President Donald Trump's Pentagon chief shot down his idea of using troops to quell protests across the United States Wednesday, then reversed course on pulling part of the 82nd Airborne Division off standby in an extraordinary clash between the U.S. military and its commander in chief.

Both Trump and Defence Secretary Mark Esper also drew stinging, rare public criticism from Trump's first defence secretary, Jim Mattis, in the most public pushback of Trump's presidency from the men he put at the helm of the world's most powerful military.

Mattis' rebuke followed Trump's threats to use the military to “dominate” the streets where Americans are demonstrating following the death of George Floyd, a black man who died when a white police officer pressed his knee into his neck for several minutes. The president had urged governors to call out the National Guard to contain protests that turned violent and warned that he could send in active duty military forces if they did not.

Esper angered Trump early Wednesday when he said he opposed using military troops for law enforcement, seemingly taking the teeth out of the president's threat to use the Insurrection Act. Esper said the 1807 law should be invoked in the United States “only in the most urgent and dire of situations.” He added, “We are not in one of those situations now.”

After his subsequent visit to the White House, the Pentagon abruptly overturned an earlier decision to send a couple hundred active-duty soldiers home from the Washington, D.C., region, a public sign of the growing tensions with the White House amid mounting criticism that the Pentagon was being politicized in response to the protests.

Former Secretary Mattis, a retired Marine general, lambasted both Trump and Esper in an essay in The Atlantic Wednesday for their consideration of using the active-duty military in law enforcement - and for the use of the National Guard in clearing out a largely peaceful protest near the White House on Monday evening.

“We must reject any thinking of our cities as a 'battlespace' that our uniformed military is called upon to 'dominate,”' Mattis wrote, referencing quotes by Esper and Trump respectively. “Militarizing our response, as we witnessed in Washington, D.C., sets up a conflict - a false conflict - between the military and civilian society. ”

Trump responded on Twitter by calling Mattis “the world's most overrated General,” adding: “I didn't like his `leadership' style or much else about him, and many others agree, Glad he is gone!”

Days ago, Esper had ordered about 1,300 Army personnel to military bases just outside the nation's capital as Trump weighed whether to invoke the Insurrection Act and send active-duty troops into the city, the scene of large protests that devolved into violence and looting over the weekend. But after a night of calm enforced by a large deployment of National Guard troops and heavily armed federal law enforcement agents, defence officials said the troops would begin returning to their home base.

Army Secretary Ryan McCarthy told The Associated Press that the decision was reversed after Esper's visit to the White House. The White House didn't respond to request for comment on whether Trump ordered the change.

The shift added to confusion over the president's threat to invoke the Insurrection Act for protests following Floyd's death in Minneapolis. White House officials had indicated even before Esper's comments that Trump was backing away from invoking the act, though officials said Trump was upset that Esper's statement conveyed “weakness.”

Press secretary Kayleigh McEnany said the president was still willing to deploy federal troops despite Esper's comments.

“If needed, he will use it,” she told reporters. “But at this time he's relying on surging the streets with National Guard. It's worked with great effect.”

Meanwhile, the president was taking credit for the deployment of federal and other law enforcement officers to the nation's capital, saying it offered a model to states on how to stop violence accompanying some protests nationwide.

On Wednesday evening, troops and others were out in force in Washington. A Defence official said at least 2,200 National Guard members would be on the streets.

Helmeted forces formed a ring around Lafayette Park across from the White House. Military vehicles were parked at intersections, also blocking access.

Trump argued that the massive show of force was responsible for protests in Washington and other cities turning more calm in recent days and repeated his criticism of governors who have not deployed their National Guard to the fullest.

“You have to have a dominant force,” Trump told Fox News Radio on Wednesday. “We need law and order.”

Asked repeatedly if Trump still had confidence in his Pentagon chief, McEnany said, “As of right now, Secretary Esper is still Secretary Esper, and should the president lose faith we will all learn about that in the future.”

Esper, in his Pentagon remarks, also strongly criticized the actions of the Minneapolis police for the incident last week that ignited the protests. He called the death of Floyd “murder” and “a horrible crime.”

The defence secretary himself has come under fire from critics, including retired senior military officers, for having walked from the White House on Monday evening with Trump and others for a presidential photo opportunity in front of St. John's Episcopal Church, which had previously sustained damage from protesters.

Esper said that while he was aware they were heading to St. John's, he did not know what would happen there.

“I was not aware a photo op was happening,” he said, adding that he also did not know that police had forcibly moved peaceful protesters in Lafayette Square to clear the way for Trump and his entourage.

Mattis, in his essay, called the scene an “abuse of executive authority.” The retired general quit the Trump administration in December 2018 after months of conflict with the president as Trump announced he was unilaterally withdrawing American troops from Syria.

The White House laid responsibility for Monday's events in Lafayette Park on Attorney General William Barr, saying he gave the order for law enforcement to clear out the protest before Trump's walk to the church ahead of Washington's 7 p.m. curfew. McEnany said the decision was made earlier Monday but had not been executed by the time Barr arrived in the park to survey the scene. He gave the order at that time.

McEnany said law enforcement conducted the operation with appropriate force, which included pepper spray and other chemical agents, and officers on horseback and batons clearing a crowd made up almost entirely of peaceful protesters.

Trump put a political spin on his criticism of states that have seen violence. He said: “You notice that all of these places that have problems, they're not run by Republicans. They're run by liberal Democrats.”

Though the crackdown on the Washington demonstrations was praised by some Trump supporters Tuesday, a handful of Republicans expressed concern that law enforcement officers risked violating the protesters' First Amendment rights.

The situation in Washington had escalated Monday, becoming a potent symbol of Trump's policing tactics and a physical manifestation of the rhetorical culture war he has stoked since before he was elected.

The clampdown followed a weekend of demonstrations outside the White House. Trump had been furious about images juxtaposing fires set in the park outside the executive mansion with a darkened White House in the background, according to current and former campaign and administration officials. He was also angry about the news coverage revealing he had gone to the secure White House bunker during Friday's protests.

Trump on Wednesday acknowledged he visited the bunker Friday but claimed he was only conducting an inspection as protests raged outside the White House gates.

Soldiers from the 82nd Airborne Division remain on standby at Joint Base Andrews in Maryland and Fort Belvoir in Virginia outside Washington.

AP writers Michael Balsamo and Lolita C. Baldor in Washington and Sarah Blake Morgan in West Jefferson, North Carolina, contributed.