(Adds comments by Governor Brown, Border Patrol's Scott)
By Deborah Bloom
PORTLAND, Ore., July 31 (Reuters) - Portland had its first night in weeks without tear gas after state police took over from federal agents guarding a courthouse that has been the focal point of violence between protesters and tactical officers.
Agents withdrew under a deal between Oregon's governor and U.S. officials to end a deployment that sparked a clash between Republican President Donald Trump and Democratic mayors over the use of federal police in U.S. cities.
A few hundred people demonstrated outside the federal courthouse until around 2 a.m. on Friday, when they left of their own accord. On previous nights they were dispersed by federal agents shooting tear gas and other munitions at "pure-on anarchists" firing commercial-grade fireworks, slingshots and chemicals, U.S. Border Patrol Chief Rodney Scott said.
"Things went a lot better last night. Last night was the first night in about two months that our officers and agents inside the federal court building there in Portland didn't come under a direct and immediate threat of being burned alive," Scott said in an interview.
Trump sent federal forces to confront what he called a "beehive of terrorists" in Portland who had set fires and broke windows at the courthouse since late May, when protests against police violence began after the death of George Floyd.
Democratic mayors said the deployment escalated tensions at largely peaceful anti-racism protests and was political theater for Trump's "law and order" campaign ahead of the Nov.3 election.
After a protester was nearly killed by a rubber bullet and several agents' eyesight permanently damaged by lasers, Governor Kate Brown agreed to send state police to the courthouse and Portland police cleared a park used as a protest staging ground. "Last night the world was watching Portland. Here's what they saw: Federal troops left downtown. Local officials protected free speech. And Oregonians spoke out for Black Lives Matter, racial justice, and police accountability through peaceful, non-violent protest," Brown tweeted.
DHS agents remain on standby and National Guard troops could be sent in should state police be overrun, DHS Acting Secretary Chad Wolf told Fox News.
A DHS spokesman said Wolf also ordered his agency to stop collecting information on journalists covering the protests after the Washington Post reported the practice.
Scott said his agents had faced "chaos" in which a mother would be peacefully protesting and then try to pull down a barrier with a rope, and someone with "Press" written on their chest would be videotaping and then fire a slingshot in an agent's face.
"We would not, nor would we ever try to systematically track or monitor legitimate journalists or protesters," he said. "It's a very, very greyer area when that same person starts attacking you." (Reporting by Deborah Bloom, Andrew Hay, Lisa Lambert, Andrea Shalal; Editing by Jonathan Oatis and Dan Grebler)