PORTLAND, Ore. — In a split opinion, the 9th U.S. Circuit Court of Appeals has restored a court injunction that bans federal law enforcement from using force, threats or dispersal orders against journalists and legal observers who are working at protests in Portland, Oregon.

The 2-1 ruling issued Friday restores an injunction issued by U.S. District Court Judge Michael H. Simon. That injunction was put on hold when the Trump administration challenged Simon's order. The ruling by the 9th Circuit restores the ban while it considers the U.S. government's appeal.

The federal agencies "assert a very important public interest, but the record fully supports the district court's conclusion that the Federal Defendants' interest does not require dispersing plaintiffs," according to the majority opinion. "They have not threatened federal property, and the journalists, in particular, provide a vitally important service to the public."

The Justice Department did not immediately comment on the ruling.

The ACLU of Oregon, which filed the initial class-action lawsuit on behalf of journalists and legal observers, applauded the news.

"This is a crucial victory for civil liberties and the freedom of the press, which are critical to the functioning of our democracy. The court's opinion affirms that the government cannot use violence to control the narrative about what is happening at these historic protests," said attorney Matthew Borden.

The lawsuit included affidavits from journalists, including a freelance photographer for the Associated Press, and legal observers who had been shot by federal officers with non-lethal munitions.

The Trump administration sent federal agents from the U.S. Department of Homeland Security to Portland this summer to help quell racial injustice protests that were increasingly targeting the Mark O. Hatfield Courthouse and other federal property.

The presence of the U.S. agents prompted thousands of residents to show up at protests.

Multiple journalists and photographers said they were targeted with tear gas, flash-bang grenades and pepper spray as they tried to document the unrest.