The demonstration went on for hours until federal agents entered the crowd at around 2.30am and marched in a line down the street, clearing remaining protesters with tear gas at close range. They also extinguished a large fire in the street outside the courthouse.
The Federal Protective Service had declared the gathering as “an unlawful assembly” and cited that officers had been injured.
As the crowd dispersed, someone was found stabbed nearby, Portland police said. The person was taken to a hospital and a suspect was detained.
By 3am, most demonstrators had left with only some small groups roaming the streets.
Earlier, the protest had drawn various organised groups, including Healthcare Workers Protest, Teachers against Tyrants, Lawyers for Black Lives and the “Wall of Moms”.
As the crowd grew – authorities estimate there were 3,000 present at the peak of the protest – people were heard chanting “Black Lives Matter” and “Feds go home” to the sound of drums.
Later, protesters vigorously shook the fence surrounding the courthouse, shot fireworks towards the building and threw glass bottles. On many occasions, such actions were met by federal agents using tear gas and flash bangs.
The flow of tear gas caused protesters to disperse at times, but some came armed with leaf blowers and directed the gas back to the courthouse.
It was unclear whether anyone was arrested during the latest protest. The federal agents, deployed by President Donald Trump to tamp down the unrest, have arrested dozens during nightly demonstrations against racial injustice that often turn violent.
Friday’s protest came hours after a US judge denied the state of Oregon’s request to restrict federal agents’ actions in the city.
Democratic leaders in Oregon say federal intervention has worsened the two-month crisis, and the state attorney general sued to allege some people had been whisked off the streets in unmarked vehicles.
US District Judge Michael Mosman said the state lacked standing to sue on behalf of protesters because the legal action was a “highly unusual one with a particular set of rules”.
Oregon was seeking a restraining order on behalf of its residents not for injuries that had already happened but to prevent injuries by federal officers in the future. That combination makes the standard for granting such a motion very narrow, and the state did not prove it had standing in the case, Mr Mosman wrote.
The clashes in Portland have further inflamed the nation’s political tensions and triggered a crisis over the limits of federal power as Mr Trump moves to send US officers to other Democratic-led cities to combat crime.
The legal action from Oregon Attorney General Ellen Rosenblum accused federal agents of arresting protesters without probable cause and using excessive force. She sought a temporary restraining order to “immediately stop federal authorities from unlawfully detaining Oregonians”.
David Morrell, a lawyer for the US government, called the motion “extraordinary” and told the judge in a hearing this week that it was based solely on “a few threadbare declarations” from witnesses and a Twitter video.
Ms Rosenblum said the ramifications of the ruling were “extremely troubling”.
She added: “While I respect Judge Mosman, I would ask this question: If the state of Oregon does not have standing to prevent this unconstitutional conduct by unidentified federal agents running roughshod over her citizens, who does?”