Oakland, California, and Portland, Oregon, are suing the Justice Department and the Department of Homeland Security.
The cities say the agencies overstepped when they sent officers to help with protests.
Protests over racial injustice and police brutality began across the country after the death of George Floyd in May.
In a statement, the DHS fired back against the lawsuit. It said it has acted lawfully.