Demonstrators, most wearing masks and many donning helmets, stood near the fountain on Salmon Street Springs, one spot where groups have been meeting before marching to the Hatfield Federal Courthouse and the federal agents there.
They chanted and clapped along to the sound of thunderous drums, pausing to listen to speakers.
Various organised groups took part, including Healthcare Workers Protest, Teachers against Tyrants, Lawyers for Black Lives and the “Wall of Moms”.
By 9.40pm on Friday, crowds of people, pressed shoulder to shoulder, packed the streets chanting “Black Lives Matter” and “Feds go home” as they carried signs and marched to the courthouse.
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.
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.
Protesters in Portland have been targeting the federal courthouse, starting fires outside and vandalising the building that US authorities say they have a duty to protect. Federal agents have used tear gas, less-lethal ammunition that left one person critically injured and other force to scatter protesters.
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?”
Before the federal intervention, mayor Ted Wheeler and other local leaders had said a small cadre of violent activists were drowning out the message of peaceful protesters. But the Democrat, who was tear-gassed this week as he joined protesters, says the federal presence is exacerbating a tense situation and he has repeatedly told them to leave.
Acting Homeland Security Secretary Chad Wolf denied federal agents are inflaming the situation in Portland and said Mr Wheeler legitimised criminality by joining demonstrators, whom Mr Trump has called “anarchists and agitators”.