A demonstrator is pepper sprayed shortly before being arrested during a Black Lives Matter protest at the Mark O. Hatfield United States Courthouse, July 29, 2020, in Portland, Oregon.
Demonstrators huddle and blow back tear gas with leaf blowers during clashes with federal officers during a police brutality protest at the Mark O. Hatfield United States Courthouse July 29, 2020, in Portland, Ore.

Governor Kate Brown of the northwestern U.S. state of Oregon said federal officers would begin leaving the city of Portland on Thursday after an agreement between local and federal officials.

The federal government said the deployment to Portland was necessary to restore order and faulted local leaders for allowing ongoing protests that they said endangered federal property, including a courthouse.

Brown was among the leaders who criticized the presence of the federal agents, saying Wednesday they “acted as an occupying force and brought violence.”  Portland Mayor Ted Wheeler said “their presence has led to increased violence and vandalism in our downtown core.”

Chad Wolf, acting secretary at the Department of Homeland Security, did not give a timeline on the withdrawal, but said state and local law enforcement would begin to take over securing streets and properties around federal properties.

“The Department will continue to maintain our current, augmented federal law enforcement personnel in Portland until we are assured that the Hatfield Federal Courthouse and other federal properties will no longer be attacked and that the seat of justice in Portland will remain secure.  This has been our mission and objective since the violent, criminal activity began,” Wolf said.

WATCH: Video report from Portland, Oregon

The federal forces were sent to Oregon’s largest city to protect a federal courthouse after weeks of demonstrations, some turning violent, sparked by the death of George Floyd in police custody in Minneapolis.

Over time the protests escalated with some demonstrators targeting the courthouse with rocks, fireworks and laser pointers. Federal agents responded with tear gas, batons, and arrests.

During the protests last week, a conservative journalist said he was stabbed outside the courthouse over his political beliefs. “I was stabbed for being a conservative journalist,” claimed Andrew Duncomb in an interview with the Oregonian/OregonLive.

Demonstrators chant slogans during a Black Lives Matter protest at the Mark O. Hatfield United States Courthouse, July 29, 2020, in Portland, Oregon.

Meanwhile, the federal government has announced it is sending federal agents to the cities of Cleveland, Detroit and Milwaukee as part of an effort to combat surges in violent crime.  That program has already involved sending agents to Chicago, Kansas City, Missouri; and Albuquerque, New Mexico this month.

Leaders in some cities have objected to the federal presence, pointing to the example of Portland, while others have welcomed them in partnership with their local law enforcement.

Cleveland Mayor Frank Jackson said Wednesday that his city has seen a rise in violent crime, particularly involving guns, “and we do need the assistance of our federal partners in order to help us bring that under control.”

Detroit Mayor Mike Duggan said his city did not ask for the federal help, but that Detroit police are ready to continue working with the agents on enforcing federal laws targeting gun trafficking and gang violence.

“We believe there is no lawful basis for Homeland Security intervention in the Detroit protests today, or for any increased presence of Homeland Security agents in our community. Today’s announcement appears to respect that position,” Duggan said.

Local and state leaders took a similar position regarding Milwaukee, with members of congress, Wisconsin’s governor and the city’s mayor sending a joint letter seeking more clarity on the duration of the deployment, how many agents would be involved, what accountability measures are in place and who is responsible for supervising their actions.

"While we appreciate your statements to press that this action is not in response to protests or civil unrest, the recent conduct of federal agents in Portland, Oregon, has caused great concern in Milwaukee and Wisconsin about the purpose and scope of any expanded federal law enforcement mission in our city and state,” the leaders wrote Tuesday to Matthew Krueger, the U.S. attorney for the eastern district of Wisconsin. “We want to make it very clear that we do not support anything similar to what we have seen in Portland, Oregon, here in Wisconsin."