President Trump announced Wednesday that he is sending more federal law enforcement agents into Chicago and Albuquerque, casting the effort as one meant to help fight crime while delivering a speech that appeared designed to score political points against Democratic leaders and burnish his law-and-order image.

Appearing at an event with top federal law enforcement officials and the family members of crime victims, Trump delivered fiery talking points that took direct aim at those who have advocated redirecting funding from law enforcement to other endeavors. He blamed the recent increases in violence in some cities on leaders who have endorsed such steps and said he planned to increase federal law enforcement’s presence to reduce crime.

The remarks seemed likely to exacerbate tensions between his administration and local officials and residents already wary of militarized U.S. officers roving their streets. Soon after he finished speaking, Chicago’s mayor accused Trump of seeking to distract from his handling of the coronavirus pandemic.

“In recent weeks, there’s been a radical movement to defund, dismantle and dissolve our police departments. Extreme politicians have joined this anti-police crusade and relentlessly vilified our law enforcement heroes,” Trump said. “To look at it from any standpoint, the effort to shut down policing in their own communities has led to a shocking explosion of shootings, killings, murders and heinous crimes of violence.”

While it is true that violence has increased in some cities recently — coinciding with a global pandemic and huge protests over racism and police brutality — experts caution against drawing a firm conclusion from such small samples of data.

The deployments, at least at first, will be focused in Chicago and Albuquerque, where Attorney General William P. Barr said the Justice Department will roll out a program it launched earlier this month in Kansas City, Mo., to increase the number of agents from the FBI, the U.S. Marshals Service, the Drug Enforcement Administration and the Bureau of Alcohol, Tobacco, Firearms and Explosives.

The program was named “Operation Legend” to honor 4-year-old LeGend Taliferro, who was shot and killed in Kansas City last month.

“Our goal is to help save lives,” Barr said.

Barr said more cities could be added to the operation in coming weeks. He said the federal government had sent more than 200 agents to Kansas City. Chicago, he said, would get a similar number, and more than 35 agents would be sent to Albuquerque.

They will be added to existing anti-violence crime task forces, Barr said. Chad Wolf, the acting homeland security secretary, said that although the operation will be led by the Justice Department, investigators from the Department of Homeland Security will also contribute.

Local officials often welcome federal help and resources to fight violent crime. Police officers frequently work together with agents from the FBI, the DEA and ATF on task forces focused on gangs, drugs or guns, and state officials often give their federal counterparts authority to help with local law enforcement.

But in large part because of the Trump administration’s aggressive, militarized response to protests over racism and police brutality, that normally cooperative relationship has been strained. The tension became particularly acute in recent days after Customs and Border Protection agents were caught on camera clubbing protesters and stuffing them into unmarked vehicles in Portland, Ore., and Trump threatened to send federal law enforcement agencies into Democratic-run cities, including New York and Chicago.

Federal officials have defended their response in Portland, asserting that officers were protecting U.S. government buildings in a city that has seen night after night of black-clad protesters throwing projectiles and attempting to set the federal courthouse on fire.

Trump’s remarks Wednesday seemed to be as focused on attacking political opponents as on detailing a public safety operation. He ticked off high-profile, violent incidents or offered data from New York, Philadelphia, Chicago and Albuquerque, which are run by Democratic mayors, and urged people to hold their local elected leaders accountable.

Among the cases he cited was one just from Tuesday evening, when 15 people were injured, two critically, in a shooting outside of a funeral home in Chicago.

“We must remember that the job of policing a neighborhood falls on the shoulders of local, elected leadership,” Trump said. “When they abdicate their duty, the results are catastrophic.”

Chicago Mayor Lori Lightfoot (D) said at a later news conference that the speech was a “political stunt.”

“The president is trying to divert attention from his failed leadership on covid-19,” she said.

Even before Wednesday’s announcement, Trump’s deployment of federal law enforcement in response to violence and civil unrest had prompted significant outrage. On Wednesday, several lawmakers from Oregon, including Sens. Jeff Merkley (D) and Ron Wyden (D), formally requested that the Justice Department and Homeland Security inspectors general investigate “the unrequested presence and violent actions of recently deployed federal forces in Portland.” Senate Democrats on Wednesday also aggressively questioned a Justice Department official who Trump has nominated to be the top lawyer for the intelligence community about the deployment.

“If the line is not drawn in the sand right now, Americans may be staring down the barrel of martial law in the middle of a presidential election,” Wyden said at the hearing.

Local officials across the country — worried about the scenes in Portland playing out on their streets — have pushed back against the administration. On Tuesday, a group of 15, including D.C. Mayor Muriel E. Bowser (D), Kansas City, Mo., Mayor Quinton Lucas (D) and Portland Mayor Ted Wheeler (D) — sent a letter to Barr and Wolf saying the deployment of federal forces to cities was “unprecedented and violates fundamental constitutional protections and tenets of federalism.” New York City’s top lawyer said Wednesday that officials there opposed the federal government sending in federal troops or law enforcement, adding, “we will fight it in court.”

Legal analysts say the administration unquestionably has the right to deploy federal officers to U.S. cities to enforce federal laws. But their power is not unlimited, and without the blessing of state or local authorities, they could not enforce state or local laws, legal analysts said.

The mayors of Chicago and Albuquerque had voiced concern over reports before the announcement that their cities might soon see an influx of federal officers. On Wednesday, though, Lightfoot noted that Trump had seemed to heed her complaints and said that adding additional officers to existing federal officers was different from the deployment of DHS personnel to respond to civil unrest — as happened in Portland.

“That doesn’t mean he’s not going to try it here in Chicago,” said Lightfoot, a former federal prosecutor. Of adding federal officers to existing federal task forces, she said: “It’s too soon to be able to say if this is a value add or not.”

Albuquerque Mayor Tim Keller (D) said in a statement: “We always welcome partnerships in constitutional crime fighting that are in step with our community, but we won’t sell out our city for a bait and switch excuse to send secret police to Albuquerque. Operation Legend is not real crime fighting; it’s politics standing in the way of police work and makes us less safe.”

In his remarks, Barr sought to draw a distinction between Operation Legend and the federal government’s response to civil unrest in Portland. In court filings, federal officials have called that deployment “Operation Diligent Valor” and said 114 officers from components of DHS and the U.S. Marshals Service are involved in protecting federal facilities.

“This is a different kind of operation, obviously, than the tactical teams we use to defend against riots and mob violence,” Barr said of Operation Legend. “And we’re going to continue to confront mob violence. But the operations we’re discussing today are very different; they are classic crime fighting.”

Charron Powell, Taliferro’s mother, also tried to separate the operation named after her son with other actions of federal law enforcement.

“It’s not to harm or to hurt,” she said. “It is to help investigate unsolved murders.”

In addition to sending more personnel, Barr said, the federal government also would be giving money to local police departments in need.

Barr claimed Operation Legend had led to 200 arrests in Kansas City in just two weeks. That, though, is incorrect, and a Justice Department official later said the figure to which Barr was referring included arrests, some by state and local officials, dating to December, long before the operation was announced. At that time, the department announced an operation with a different name, “Relentless Pursuit,” aimed at combating violent crime in seven cities, including Kansas City.

Like Trump, though, Barr blamed recent upticks in violence on efforts to defund the police.

“This rise is a direct result of the attack on the police forces and the weakening of police forces,” he said.

After the recent shooting at the funeral home, David Brown, the Chicago police superintendent, decried what he called a “cycle of violence . . . fueled by street gangs, guns and drugs.” He said this cycle was an endless procession of shootings and retaliation that left people feeling hopeless and unsafe in their neighborhoods.

“The cycle of violence in Chicago: Someone gets shot, which prompts someone else to pick up a gun,” he said. “This same cycle repeats itself, over and over and over again. . . . The response, too often, is picking up a gun to seek vengeance.”

Mark Berman and Ellen Nakashima contributed to this report.