PORTLAND, ORE. -- The Trump administration and Oregon leaders declared victory after it was announced that U.S. agents guarding a federal courthouse during violent demonstrations in Portland will pull back, but it wasn't clear the agreement will reduce tensions that have led to more than two months of protests.

Oregon Gov. Kate Brown said Wednesday that agents with U.S. Customs and Border Protection and Immigration and Customs Enforcement will begin leaving the city's downtown area on Thursday.

But Acting Secretary for the Department of Homeland Security Chad Wolf wouldn't specify where they would go. He insisted a federal presence would remain in Portland until the Trump administration is convinced the agreement is working and Oregon State Police troopers are effectively protecting federal property.

Hours after the deal was announced, protesters and federal agents faced off again Wednesday night on downtown streets near the Mark O. Hatfield Federal Courthouse.

Thousands of demonstrators turned out, drawing dozens of agents in Department of Homeland Security and Customs and Border Protection uniforms from the courthouse. Clashes that dragged into Thursday morning brought tear gas, impact munitions and more arrests.

Later Thursday morning, when the streets were calm again, city workers cleared benches and tents from a park across the street from the courthouse that had been used as a staging ground for the protesters. They also kicked out homeless people who had been sleeping in the park. Mayor Ted Wheeler said the moves were part of the deal to secure the Oregon State Police patrols.

But President Donald Trump assailed Brown on Twitter Thursday, saying she was not doing enough to control the "anarchists & agitators" in Portland.

"If she can't do it, the Federal Government will do it for her. We will not be leaving until there is safety!" he tweeted.

Many of the demonstrators in Portland are peaceful, but smaller numbers hurl fireworks, flares, rocks and ball bearings at federal agents, use green lasers to blind them and spread graffiti on the federal courthouse.

Trump earlier this month sent the agents to Portland as protests against racial injustice increasingly targeted U.S. government property, including the stately Portland courthouse. But the deployment appeared to have the opposite effect, reinvigorating demonstrators who crafted a new goal of getting rid of the federal presence.

The deescalation plan calls for the U.S. Marshals Service and Federal Protective Service agents to remain inside a fence set up around the federal courthouse, along with some state police, to keep protesters out. State police will also be outside the fence to keep protesters back.

After the deal was reached, Wolf told reporters the federal "law enforcement presence in Portland will remain in Portland, whether they're staying inside the courthouse, next door or a different location."

OSP Superintendent Travis Hampton said his agency would deploy a special operations team and some uniformed troopers to the courthouse for a two-week rotation.

The agency hopes its efforts will allow a tall protective metal courthouse fence that was recently propped up with concrete highway barriers to be removed and "restore a semblance of normalcy, while meeting community expectations and our obligations to protect the federal property," Hampton said. He added that the troopers dispatched to the site are Oregon residents.

At a stand providing free food for protesters in a park across the street from the courthouse, Tyler Smith flipped burgers Wednesday afternoon and said he thought the deal to pull back the U.S. agents was a "great idea."

"I've been thinking this needs to be handled by the state or by the city for some time," Smith said. State troopers might take a softer approach with the protesters because the troopers are from Oregon, Smith said.

The agreement also calls for the U.S. government to clean the graffiti off of the courthouse, which is federal property. Wheeler, the mayor, has said federal officials previously refused to clean the courthouse, contributing to the impression that the entire city was under siege.

Like many other protests nationwide touched off by the police killing of George Floyd in Minneapolis, the Portland demonstrations sought to highlight and call for an end to racial injustice. But they had increasingly focused on federal property even before the U.S. agents arrived.

Brown cautioned Wednesday that the lower visibility of the federal agents -- and their ultimate departure -- won't immediately resolve the conflict at the courthouse.

"The violence, the property destruction, which includes burning of trash cans and throwing of rocks, that must stop," the governor told The Associated Press.

Many protesters want reduced funding for the Portland Police Bureau and are angry that city officers used tear gas on protesters multiple times before federal agents arrived. Brown said the departure of the federal agents was a chance to address that anger and to begin to make improvements in community policing.

"This was a political theatre for the Trump administration to bring federal troops into Portland streets. It was about winning political points with their base," she said.

------

Balsamo reported from Washington. Associated Press writers Zeke Miller and Colleen Long in Washington and Suman Naishadham in Atlanta contributed to this report.