PORTLAND, Ore. — Protesters who have clashed with authorities in the Pacific Northwest are not just confronting local police. Some are also facing off against federal officers whose presence reflects President Trump’s decision to make cracking down on “violent mayhem” a federal priority.

The Department of Homeland Security has deployed officers in tactical gear from around the country, and from more than half a dozen federal law enforcement agencies and departments, to Portland, Ore., as part of a surge aimed at what a senior official said were people taking advantage of demonstrations over the police killing of George Floyd to engage in violence and vandalism.

“Once we surged federal law enforcement officers to Portland, the agitators quickly got the message,” said the official, speaking on condition of anonymity to discuss an ongoing operation.

The deployment represents somewhat of a departure for Homeland Security, which was created after the Sept. 11, 2001, attacks and is primarily focused on threats from abroad and border security. During the Trump presidency, its focus has been largely on carrying out the president’s tough immigration agenda. Now it is in the role of supporting Trump’s “law and order” campaign, raising questions about whether it is overstepping the duties of local law enforcement.

Portland Deputy Police Chief Chris Davis said his department did not request the assistance and did not coordinate efforts with the federal government during often chaotic clashes that have ranged across several downtown blocks after midnight for weeks.

“I don’t have authority to order federal officers to do things,” Davis said. “It does complicate things for us.”

The Homeland Security officers’ presence comes at a tense moment for Portland. After Floyd’s death, the city for days saw rallies that attracted thousands of generally peaceful protesters to the downtown area. The police took a “mostly hands-off approach” to those events because they were orderly, Davis said.

Trump, speaking at a military base near Miami on Friday, said Portland officials failed to adequately respond to the protests. “It was out of control,” he said to acting Homeland Security Secretary Chad Wolf. “The locals couldn’t handle it, and you people are handling it very nicely.”

Civil liberties advocates and activists have accused federal authorities of overstepping their jurisdiction and excessive use of crowd control measures, including using tear gas and patrolling beyond the boundaries of federal property. Portland police are prohibited from using tear gas under a recent temporary court order unless they declare a riot.

“DHS should go back to investigating the rise of white supremacist activity and actors who are seeking to cause violence against these peaceful protests; that is under the purview of the agency’s mission,” said Andrea Flores, the deputy director of immigration policy at the American Civil Liberties Union, who was a Homeland Security official during the Obama administration.

Trump issued an executive order on June 26 to protect monuments after protesters tried to remove or destroy statues they considered racist. He has denounced the Black Lives Matter movement and protests calling for the removal of statues honoring racist figures, associating peaceful protests with the sporadic outbursts of vandalism and theft at some demonstrations. In his July 3 speech at Mt. Rushmore, he referred to “the violent mayhem we have seen in the streets of cities that are run by liberal Democrats” as well as the “merciless campaign to wipe out our history.”

Following the executive order, Homeland Security created the Protecting American Communities Task Force and sent officers from Customs and Border Protection and other agencies to Washington, D.C., Seattle and Portland. Others were ready to deploy elsewhere if needed.

Improving coordination among law enforcement agencies is part of Homeland Security’s mission. It also oversees the Federal Protective Service, which guards federal government buildings around the nation. But that agency doesn’t have the resources to respond to the sustained attacks that have taken place in Portland and elsewhere on the margins of protests.

Federal Protective Service Officer David Underwood was shot and killed outside a federal building in Oakland during a May protest. Authorities charged an Air Force staff sergeant affiliated with the far-right, antigovernment “boogaloo” movement with his killing.

As local governments in Washington, D.C., and Portland have stepped back to allow space for peaceful demonstrations, the Trump administration has stepped up its effort against what the senior official called “opportunistic criminals.”

Atty. Gen. William Barr says there have been more than 150 arrests on federal charges, including destruction of property and assault, around the country, with about 500 investigations pending related to recent protests.

Portland police officials say the cycle of nightly attacks, which have shut down much of downtown, has been unprecedented. Early Thursday, a man in an SUV fired several times into the air as he drove away from protesters who had surrounded his car. “We’ve never seen this intensity of violence and focused criminal activity over this long period of time,” Davis said.

Among the federal forces deployed in Portland are members of an elite Border Patrol tactical team, a special operations unit that is based on the U.S.-Mexico border and has been deployed overseas, including to Iraq and Afghanistan.

BORTAC members are mixed in with Federal Protective Service officers outside the courthouse. Others in the unit, which includes snipers, have been stationed in “overlook” positions in the courthouse, where a protester shined a green laser into the eyes of one of the officers on Monday, according to court documents.