The Pentagon scrambled to deploy more than a thousand National Guard forces to help protect the Capitol on Wednesday after they had remained on the sidelines during a limited early deployment while rioters stormed Congress.

The absence of authorized military personnel while chaos upended the certification of the presidential election was a stark contrast to the military’s role in protests for racial justice in June, when National Guard helicopters flew perilously low over crowds of demonstrators, front-line forces massed near the city, and Pentagon leaders were criticized for appearing to support President Trump’s heavy-handed response.

This time, Pentagon officials appeared determined to steer clear of the politically charged fray, acting in lockstep with city leaders as they outlined a small, minimally visible role for the D.C. National Guard, and none at all for active-duty military forces.

That decision faced intensified scrutiny later Wednesday after Trump supporters, many of them wearing tactical gear, crashed through defenses erected by D.C. and Capitol police and pushed inside the Capitol, forcing lawmakers to halt election certification proceedings and evacuate in fear. A woman was fatally shot inside the Capitol, officials said.

In a statement issued after those events, acting defense secretary Christopher C. Miller said the Pentagon had mobilized all available D.C. National Guard forces, amounting to some 1,100 service members, and would provide additional support as requested.

“Our people are sworn to defend the constitution and our democratic form of government and they will act accordingly,” he said.

The decision to deploy the D.C. Guard was up to Miller. Though he discussed the situation with Vice President Pence, it was Miller who ultimately authorized the full deployment, according to a senior U.S. official, who noted that the vice president doesn’t have the power to make that decision because he isn’t in the chain of command.

Because D.C. is not a state, the D.C. Guard answers to the president, but he has delegated authority to command the capital’s guardsmen to Miller and Army Secretary Ryan McCarthy — two of the top officials at the Pentagon.

The governors of Maryland and Virginia also activated state troopers and members of their Guards to help respond to the situation.

Late on Wednesday, a defense official said that thousands of additional National Guard troops from Maryland, Virginia, New Jersey, New York, and Delaware would be positioned outside of Washington to be on stand-by if they were needed.

Officials said the Justice Department would lead the law enforcement response. Responsibility to protect the Capitol, which is federal territory, falls to the Capitol Police, which reports to Congress. But the National Guard is trained to support federal and local law enforcement during civil unrest.

Still, the dramatic events generated questions about why the military remained on the margins of a well-publicized protest whose members made no secret of their desire to use force.

“Questions will be asked about the adequacy of the planning by the various law enforcement organizations tasked with protecting the Capitol against violent disorder like this,” said Peter Feaver, a professor of political science and an expert in civil-military relations at Duke University.

Last year, during the racial justice protests, Trump ordered a vast contingent of guardsmen onto the streets of Washington and fell out with Pentagon leadership after his defense secretary warned against deploying active-troops under the Insurrection Act in the capital’s streets. But as the president’s supporters signaled their intent to descend upon Congress this week, Trump issued no such orders.

In his statement on Wednesday, Miller said he and the chairman of the Joint Chiefs of Staff, Gen. Mark A. Milley, consulted with Pence, House Speaker Nancy Pelosi (D-Calif.), Senate Minority Leader Charles E. Schumer (D-N.Y.) and House Majority Leader Steny H. Hoyer (D-Md.) before fully activating the D.C. Guard, but Miller didn’t mention any consultations with Trump.

The scenes of Trump supporters storming into the Capitol stunned former military and Pentagon leaders.

“Today’s violent assault on our Capitol, an effort to subjugate American democracy by mob rule, was fomented by Mr. Trump,” former defense secretary Jim Mattis, who resigned in December 2018, said in a statement.

“His use of the Presidency to destroy trust in our election and to poison our respect for fellow citizens has been enabled by pseudo political leaders whose names will live in infamy as profiles in cowardice,” Mattis said. “Our Constitution and our Republic will overcome this stain and We the People will come together again in our never-ending effort to form a more perfect Union, while Mr. Trump will deservedly be left a man without a country.”

Retired Gen. Joseph F. Dunford Jr., who was Trump’s first chairman of the Joint Chiefs, called what occurred in Washington “an outrageous assault.”

“I believe our leaders who have continued to undermine a peaceful transition in accordance with our Constitution have set the conditions for today’s violence,” he said in a statement.

The events of recent weeks, as Trump has used an expanding array of means to try to overturn President-elect Joe Biden’s electoral win, has also revived fears among many Americans that Trump might try to employ the military in his quest to remain in office.

While preparing for Wednesday’s demonstrations, Pentagon leaders were still smarting from criticism of their role in the Trump administration’s outsized and militarized response to protests in the capital following the police killing of George Floyd in Minneapolis. That included the deployment of guardsmen from D.C. and 11 states, as well as the staging of active-duty troops outside the capital and the deployment of federal agents without insignia.

Members of the National Guard were also on site at the White House when federal law enforcement cleared protesters in Lafayette Square with tear gas and rubber pellets, allowing Trump to cross the street to take a photograph with a Bible in front of St. John’s Church.

With those events in mind, top defense officials specifically ensured that the 340 members of the D.C. Guard whose activation were requested this week by D.C. Mayor Muriel E. Bowser would stay away from the Capitol to avoid the poor optics of uniformed military personnel and Humvees flanking civilian protesters.

One senior U.S. official told The Washington Post on Tuesday, ahead of the demonstrations, that at the Pentagon, “everyone has got a lot of scar tissue and a lot of PTSD from the domestic unrest of the summer” and didn’t want a repeat. The official added, “We’ve learned our lessons and will be absolutely nowhere near the Capitol Building.”

As Trump supporters gathered in central Washington on Wednesday, however, the events quickly spiraled beyond the control of Capitol and D.C. police.

During a midday phone call with Pentagon leaders, Capitol Police requested about 200 troops from the D.C. Guard for immediate backup, according to a person familiar with the call who spoke on the condition of anonymity because they were not authorized to discuss the matter publicly. But Pentagon leaders didn’t immediately approve the request, according to people familiar with the conversation.

McCarthy — who wasn’t on the call, according to one person familiar with it — said later at a news conference that there was “a little bit of confusion” after the request but that the Pentagon decided about a half-hour later to mobilize the entire D.C. Guard, though the Defense Department left it to the federal law enforcement to clear the Capitol of the rioters.

Rep. Elissa Slotkin (D-Mich.) said she texted Milley, chairman of the Joint Chiefs, while sheltering in place with other lawmakers.

I wanted them to understand from someone that they knew and someone had seen worse that this was a rapidly developing security situation and I couldn’t say with clarity that the situation was under control,” said Slotkin, who previously served as a senior Pentagon official and intelligence analyst in Iraq.

When Milley called her back, he said that Guard forces, not active-duty troops, would be deployed. “He was like, ‘We got it, We're on it,’ ” she said.

Speaking later alongside Bowser at a news conference, McCarthy said he had fully mobilized the D.C. Guard at about 3 p.m.

By early evening, the National Guard had been ordered to reestablish a perimeter around the Capitol, where they stood behind D.C. police with riot shields. Officials said National Guard forces would carry shields and batons but no firearms.

The task of clearing the Capitol itself has fallen primarily to federal law enforcement agents, with acting attorney general Jeffrey Rosen overseeing the response.

The National Guard didn’t ask to deploy aircraft as part of the response, an additional point of contrast to June, when a pair of Guard helicopters roared over demonstrators, flying as low as 45 feet and prompting fierce criticism and an ongoing investigation.

“Here it seems it’s disproportionate force on the other side of the spectrum,” said Rachel E. VanLandingham, a military law expert and professor at the Southwestern Law School in Los Angeles.

Feaver said that given all the advance warning from Trump supporters about their willingness to escalate to violence, one would have expected authorities to have a robust plan in place with contingencies assessed and war games run, with the National Guard in a backup role.

“Given what happened in June, authorities are understandably wary about escalating to the National Guard,” Feaver said. “That said, no mature and secure democracy wants to see its legislative chambers taken over by violent mobs.”

Slotkin placed greater responsibility on the Capitol Police and D.C. police, rather than the National Guard, for how the breakdown occurred and said she expected an after-action review.

Former defense secretary Mark T. Esper, whom Trump fired in November over his pushback to Trump’s attempt to use military forces to quash protests in June, wrote on Twitter that he was confident the military would stay out of politics in the coming weeks.

“This must end now for the good of the republic,” he said.

Devlin Barrett contributed to this story.