DNY59/iStockBy LUKE BARR, ABC News

(WASHINGTON) -- Portland, Oregon, and Oakland, California, sued the Department of Justice and Department of Homeland Security over the use of federal agents and officers in their cities during unrest and protests.

The 50-page lawsuit accuses both departments of "unilaterally, unlawfully, and unconstitutionally" instituting a "law and order" policy and deploying federal agents to cities.

Throughout the summer in Portland, federal agents from the DHS and U.S. Marshals, which fall under the Department of Justice, were deployed, the department said, to primarily protect the federal courthouse. In Oakland, federal agents were also tasked with protecting federal property.

"This lawsuit challenges the unlawful and unconstitutional overreach of federal law enforcement in response to and in anticipation of civil protests in progressive United States cities," the lawsuit filed in federal court on Wednesday says. "In particular, the lawsuit challenges the federal government's new policy authorizing the expanded and unbounded jurisdiction of federal law enforcement under the guise of protecting federal property, and the federal government's related and unconstitutional practice of commandeering local law enforcement officers for similar ends."

In a statement, the Department of Homeland Security railed against the lawsuit.

"Yet again, dangerous politicians and fringe special interest groups have ginned up a meritless lawsuit," a spokesperson told ABC News. "They aim to harm President Trump and distract from his law and order agenda. The Department of Homeland Security has acted entirely lawfully. Instead of condemning the violence we are seeing across the country, these politicians focus on scoring cheap political points to the detriment of the American people."

In June, President Donald Trump signed an executive order dedicating federal resources to protect federal monuments. The cities allege the department used that executive order to protect monuments as a guise to go into these cities and say the agencies kept expanding the purview of the order.

Critics, such as former DHS Secretary Michael Chertoff, a Republican, have raised questions about the scope of federal agents in Portland.

"You can protect federal property, but that doesn't mean it's an unlimited license to roam around the streets and pick up people based on some suspicion that maybe they're involved or gonna be involved in something," Chertoff told ABC News' "Powerhouse Politics" podcast in July.

Acting Secretary Chad Wolf and Attorney General William Barr have both defended the use of federal agents in these respective cities.

"Some elected officials and those in the media have tried to smear our law enforcement officers, who are performing their jobs valiantly and consistent with the law and use of tactics and procedures. They have called our law enforcement professionals 'stormtroopers,' the 'Gestapo' and 'thugs.' These are offensive and irresponsible terms," Wolf said in front of the Senate Homeland Security Committee in August.

In front of the House Judiciary Committee in July, Barr also defended the use of federal agents in Portland.

"The most basic responsibility of government is to ensure the rule of law, so that people can live their lives safely and without fear. The Justice Department will continue working to meet that solemn responsibility," Barr said.

Copyright © 2020, ABC Audio. All rights reserved.