The White House said Tuesday that President Trump will restore law and order with federal agents in cities such as Portland, Oregon, saying federal law authorizes him to protect federal buildings and investigate crimes.

White House press secretary Kayleigh McEnany said Democratic Gov. Kate Brown of Oregon and Portland Mayor Ted Wheeler “are unwilling to admit that they have lost control of their city.”

“The well-organized mob in Portland has become increasingly aggressive, especially against law enforcement officers,” she said. “Individuals have thrown bricks, chunks of concrete, glass bottles, feces, balloons filled with paint, pig’s feet, slingshot several ball bearings and batteries at federal agents and the courthouse.”

Ms. McEnany said Mr. Trump “is taking action in Portland, even though you have a Democratic mayor and Democratic governor unwilling to work with us.”

Democrats and some Republicans such as Sen. Rand Paul of Kentucky have objected to federal agents using unmarked vehicles to carry out operations in Portland. Ms. Brown called them “secret police,” and Mr. Wheeler has asked the administration to remove its agents.

Ms. McEnany said federal law gives the Department of Homeland Security the authority to deputize officers in any agency such as Immigration and Customs Enforcement, Border Patrol and the Secret Service for duty protecting property owned or occupied by the federal government, and persons on that property.

“When a federal courthouse is being lit on fire, commercial fireworks being shot at it, being shot at the officers, I think that falls pretty well within the limits” of the law, she said.