President Donald Trump's administration on Wednesday agreed to a deal to defuse weeks of clashes in the US city of Portland with the withdrawal of federal forces whose presence enraged protesters, but the timing remained in dispute.

Oregon Governor Kate Brown said the forces -- whose deployment was seen by many as part of Trump's law-and-order strategy for re-election -- would begin their phased pullout on Thursday.

Acting Homeland Security Secretary Chad Wolf indicated, however, that the officers will withdraw only if there are guarantees that local police can ensure the federal courthouse will be secured.

Trump's administration earlier this month sent the federal tactical teams, many wearing combat-like gear, to intervene in the western city after weeks of protests against racism and police brutality saw windows broken and graffiti scrawled on the federal courthouse and other buildings.

Federal officers are pictured in Portland, Oregon on July 25, 2020 -- the city has been rocked by weeks of clashes between demonstrators and law enforcement
Federal officers are pictured in Portland, Oregon on July 25, 2020 -- the city has been rocked by weeks of clashes between demonstrators and law enforcement AFP / Ankur Dholakia

But their deployment only served to inflame the situation, especially following video footage of protesters being snatched off the street by federal forces and put into unmarked cars.

"After my discussions with (Vice President Mike) Pence and others, the federal government has agreed to withdraw federal officers from Portland," Brown tweeted Wednesday.

"They have acted as an occupying force & brought violence. Starting tomorrow, all Customs and Border Protection & ICE officers will leave downtown Portland."

In his statement, Wolf said he and Brown had "agreed to a joint plan to end the violent activity in Portland directed at federal properties and law enforcement officers."

Mothers form a human chain during a protest in Portland
Mothers form a human chain during a protest in Portland AFP / Ankur Dholakia

"That plan includes a robust presence of Oregon State Police in downtown Portland," he said.

But Wolf set no timeline for a pullout, stressing that the "current, augmented federal law enforcement personnel in Portland" would remain until being assured that federal properties "will no longer be attacked" in the city.

Protesters on the streets of Portland on Wednesday night were skeptical that the withdrawal would proceed.

"I don't think the Feds are going to leave, and if they do, the movement continues," said 23-year-old Constantine, one of around 2,000 people gathered outside the city's Federal Court building.

Federal law enforcement officers later fired tear gas and rubber bullets to disperse the crowd.

Federal police guard the Mark O. Hatfield federal courthouse in downtown Portland as protesters take part in a rally against police brutality late on July 24, 2020
Federal police guard the Mark O. Hatfield federal courthouse in downtown Portland as protesters take part in a rally against police brutality late on July 24, 2020 AFP / Kathryn ELSESSER

Despite Wolf's announcement, Trump doubled down on the need for federal intervention in the city, threatening to send in the National Guard if the violence continued and calling the protesters anarchists.

"I told my people a little while ago, if they don't solve that problem locally very soon, we're going to send in the National Guard and get it solved very quickly," he told an energy conference in Texas.

"They want to solve their problem. They've got a very short time to do it. But they'll either solve that problem or we'll send in the National Guard," he added.

In parallel with the contested crackdown in Portland, the administration has sent federal agents to supplement local law enforcement in several US cities facing a rise in gun crime such as Chicago, Kansas City and Albuquerque -- compounding public anger over the situation in Portland.

Wednesday's announcement on Portland came as Trump's administration said it was expanding the controversial "surge" of federal agents to three more US cities -- Cleveland, Detroit and Milwaukee.

In a statement, Barr said all three Democratic-run cities "have seen disturbing increases in violent crime, particularly homicides."

As part of so-called "Operation Legend," just under 100 agents will head to the three Great Lakes cities, according to the Justice Department.

The announcement on Portland came a day after officials in neighboring Washington state said that federal police sent to the city of Seattle last week had left the area.

Portland's Mayor Ted Wheeler welcomed the withdrawal of the officers from his city, tweeting Wednesday that their presence had sown fear in the community.

"Federal agents nearly killed a demonstrator, and their presence has led to increased violence and vandalism in our downtown core," he said.

"The Governor and I agree: Oregon resources, expertise, and values are sufficient to manage Oregon issues," he added.