The Trump administration is planning to withdraw some federal security forces from Portland, Oregon, after weeks of clashes with protesters.
US Homeland Security Secretary Chad Wolf said the pull-out was conditional on local police protecting federal buildings, the focal point of unrest.
Oregon Governor Kate Brown said federal agents would start leaving the state's biggest city from Thursday.
Portland has been rocked by 62 consecutive days of demonstrations.
What did federal and state officials say?
In his statement, the US homeland security secretary set no timeline for a pull-out.
But he said he and the governor had "agreed to a joint plan to end the violent activity in Portland directed at federal properties and law enforcement officers".
"That plan includes a robust presence of Oregon State Police in downtown Portland."
He added that "state and local law enforcement will begin securing properties and streets, especially those surrounding federal properties, that have been under nightly attack".
The governor tweeted on Wednesday: "They have acted as an occupying force & brought violence. Starting tomorrow, all Customs and Border Protection & ICE officers will leave downtown Portland."
But she added that federal officers from the US Marshals Service and Federal Protective Service will stay at the courthouse, where they are usually based.
After the announcement, Mr Trump, a Republican, declared victory, tweeting: "If the Federal Government and its brilliant Law Enforcement (Homeland) didn't go into Portland one week ago, there would be no Portland.
"It would be burned and beaten to the ground. If the Mayor and Governor do not stop the Crime and Violence from the Anarchists and Agitators immediately, the Federal Government will go in and do the job that local law enforcement was supposed to do!"
What happened in Portland?
Federal officers were sent there on 4 July to protect federal buildings that were vandalised during weeks of protests against racism and police brutality following the death of George Floyd, an unarmed black man, in Minneapolis, Minnesota, in May.
Their deployment exacerbated the civil unrest, especially when footage emerged of demonstrators being grabbed off the street by federal officers and forced into unmarked cars.
The governor and Portland Mayor Ted Wheeler, both Democrats, complained they never asked for the federal intervention, blasting it as an election-year stunt by the US president.
The Mark O Hatfield Federal Courthouse in the city centre has become a nightly battleground, with both federal officers and demonstrators injured in bloody confrontations.