Military Humvees glide along the wide avenues of the District. Armored vehicles for days blocked streets that were no longer under the control of D.C. police. Federal officers wearing combat gear and cradling rifles have been spotted without name tags or even agency insignia. Soldiers guard the monuments.

The Trump administration’s decision to send federal officers into the District in response to days of sometimes volatile demonstrations has given the nation’s capital the appearance of an armed camp, with the District’s mayor and police chief appearing sidelined and federal officers unaccountable to local residents and their elected leaders.

A Justice Department official said the additional federal law enforcement officers on the ground in the District number in “the thousands.”

“It is a definite feeling that our city is being occupied by federal forces,” said Michael G. Tobin, who heads a District office that investigates complaints against D.C. police. He also is a former colonel in the Army National Guard, who, along with members of the D.C. Council, were barred by an armed Department of Homeland Security officer from walking down part of Virginia Avenue on Tuesday.

D.C. Mayor Muriel E. Bowser (D) on Thursday made her dismay clear, saying, “We want out-of-state troops out of Washington, D.C.”

She noted the District’s futile push for statehood and full autonomy.

“Until we get that fixed,” the mayor said, “we are subject to the whims of the federal government. Sometimes they are benevolent and sometimes they are not.”

Earlier in the week, Bowser noted she does not have a complete list of which federal agencies are patrolling the city.

“We should all be concerned about who is giving the orders,” she said at a news conference, succinctly explaining that her police chief directs his officers and the federal government directs theirs.

Over the past few days, federal officers and members of the National Guard from as far away as Utah have closed streets and shrunk the public space available to protesters, which District leaders say was done without their approval. Federal officers dress in riot gear and may display firearms even when demonstrations are peaceful, times when D.C. police remain in casual dress.

Many of the federal officers have been spotted without name tags and in uniforms that do not say which agency they represent. D.C. police are required to wear name tags, even when dressed in riot gear. Many of the federal officers carry shields that say only “military police” or acronyms not readily familiar to civilians, such as “S.O.R.T,” which is the Bureau of Prisons Special Operations Response Team. And many have refused to identify what agency they represent to reporters.

House Speaker Nancy Pelosi (D-Calif.) wrote to President Trump on Thursday questioning the use of federal police officers in the District. “We are concerned about the increased militarization and the lack of clarity that may increase chaos,” she wrote.

And Rep. Don Beyer (D-Va.) is working on legislation that would require federal officers to provide their names. He tweeted, “Denying accountability to the public they serve ensures ­abuses.”

Bobby Chesney, a law professor at the University of Texas at Austin, said federal agents’ refusal to identify themselves or their agency in this context of the protests is unwise and can lead to “dangers of confusion or a mistake in escalation if there’s doubt as to whether these are legitimate government officials.”

Demonstrators who have come to protest the death of George Floyd in police custody in Minneapolis see the massive security presence as an affront to their right to make their voices heard.

Asad Caicedo, 18, arrived at Lafayette Square on Wednesday night to demonstrate and instead found an entire street blocked off with a military vehicle, blocking the view of the main source of his ire, the president’s home. “It’s tyranny,” Caicedo said. “Our ability to protest is being violated with these blockades.”

Early Thursday, a Dodge SRT stopped 30 yards from a line of National Guard members standing shoulder-to-shoulder holding riot shields on 16th Street NW near the Hay-Adams hotel. Tensions briefly rose as the vehicle gunned its engine, and then Nipsey Hussle’s “FDT” — a scathing protest anthem against Trump — blared from the vehicle.

“I wanted them to get the message that they’re standing in the way of us,” said the driver, Mohamed Ja, 26. “They’re standing in the street. This is our street that we paid for with our tax dollars. I have the right to go down the street to make a right turn, or make a left, but they are blocking us.”

Demonstrations in the city, which began Friday night, have largely been peaceful. But there have been moments of unrest that left stores looted, buildings burned and scores of police officers from the District and federal agencies injured from rocks, bricks and incendiary devices.

Attorney General William P. Barr ordered all the Justice Department’s “law enforcement components” to “assist in the restoration of order to the District of Columbia,” according to a statement. Among the agencies listed were the Drug Enforcement Administration, the Bureau of Alcohol, Tobacco, Firearms and Explosives, U.S. Marshals Service, the Bureau of Prisons and the FBI. There are other federal agencies in the District as well, such as Customs and Border Protection and the Department of Homeland Security, among others.

Barr on Thursday said that while the D.C. police have experience dealing with protests, the federal government had its own interest in protecting its property. But, he said, “this is a federal city, the seat of the federal government.”

Barr said Tuesday and Wednesday were “peaceful,” and he was “pleased with that.” He suggested the dramatic federal response might soon let up and take on a “more low-profile footprint.”

A Justice Department official who spoke on the condition of anonymity to discuss internal procedures said the agency has been informing D.C. police of its efforts to position federal law enforcement on city streets.

“MPD has been a part of the briefings that DOJ has participated in at the command center at the FBI’s Washington Field Office every two hours,” the official said.

Another Justice official credited the federal force with tamping down the unrest.

“What would be the alternative, letting people burn down the city?” the official asked.

The dynamic in the city follows Trump’s urge to local leaders that they “dominate” unruly demonstrations. The chairman of the Joint Chiefs of Staff appeared outside the White House in combat fatigues. And Defense Secretary Mark T. Esper referred to American cities as a “battle space.”

The president has floated the idea of a federal takeover of D.C. police and threatened to send active-duty military into the District. For now, the Justice Department says the National Guard is supporting civilian authority and is not making arrests.

But District leaders say the show of force still runs counter to the norms of civilian policing.

The forceful removal of demonstrators at Lafayette Square has been roundly denounced and described as “shameful” by the mayor. An Army helicopter from the D.C. National Guard buzzed low over a city street, using its downward draft from the rotors to scatter demonstrators, a tactic used in wartime maneuvers. And Park Police officers were captured on video using a shield to shove Australian journalists and were removed from protest duties after that government called for an investigation.

D.C. Police Chief Peter Newsham said he wasn’t given a heads-up when the U.S. Secret Service, Park Police and National Guard forcefully cleared the park, nor was he part of the decision by federal authorities to close part of 16th Street and H and I streets NW, to expand the perimeter around the president’s home.

“D.C. residents need access to D.C. streets,” Bowser said.

By Thursday, the police chief said the administration had successfully pushed back and the federal line retreated to Lafayette Square.

D.C. police, perhaps more than those in any other city, have close working relationships with a multitude of federal law enforcement agencies that crisscross the city every day — from the U.S. Capitol Police to the Secret Service. They coordinate on major security events, such as presidential inaugurations and planned mass gatherings, and on smaller crimes. Bowser said those ties remain strong. But she singled out the extra federal forces being deployed, saying, “I can’t say more about other agencies, about who is directing them.”

Bowser did ask for the D.C. National Guard, which in the District reports to the president, but to help only with traffic control and not the more expansive role it has taken on.

D.C. Attorney General Karl A. Racine said Thursday that his office is investigating whether the federal government had the legal authority to call National Guard troops from several states into the District. As part of that inquiry, letters posing a series of questions were sent to federal officials and several state governors and attorneys general.

A letter to Barr, Esper and White House Chief of Staff Mark Meadows asked under “what authority” the troops were brought in, their “stated mission” and “who determined that mission.”

Tobin, from the D.C. police complaints office, has spent each night of the demonstrations monitoring the conduct of officers on the streets. A couple of nights ago, he was with D.C. Council member Charles Allen (D-Ward 6) and other elected officials when he said they were blocked from Virginia Avenue.

“Here’s three locally elected officials and a local public safety director and we’re prohibited from walking down a D.C. street to meet up with our own local police officers,” Tobin said. “It seems to me the federal law enforcement agents are operating on different standards than those we would allow for our own police department.”

The council member, Allen, said he is “deeply concerned with this militarized federal police force.”

Allen said that “the rules don’t apply to them. They have no body cameras, no name tags. You’ll be lucky if you can figure out which insignia that’s on their patch. I don’t think there is any accountability. It makes me scared for what they can do and what they will do to residents who are peacefully protesting.

“It teeters on authoritarianism. It teeters on dictatorship.”

Rebecca Tan, Tom Jackman, Devlin Barrett, Fredrick Kunkle, Missy Ryan, Dan Lamothe, Perry Stein, Matt Zapotosky and Emily Davies contributed to this report.