A federal judge has permanently barred California from enforcing four state laws that regulate federal law enforcement officers and agencies, the Justice Department announced Thursday.

According to the department, U.S. District Judge Christina A. Snyder of the Central District of California entered the injunction. It applies to the State of California, Gov. Gavin Newsom and Attorney General Rob Bonta, both named in their official roles. The order covers two sections of the state Government Code (7288 and 7289) and two sections of the state Penal Code (185.5 and 13654). It bars enforcement against the United States, federal officers and federal agencies.

The department said the injunction was part of a final resolution of its lawsuit. The release says the action was dismissed with prejudice, meaning it cannot be filed again, under the parties’ final resolution. The court keeps jurisdiction to carry out and enforce the final judgment.

The Justice Department alleged in its lawsuit that the laws unlawfully interfered with federal operations. It said they limited the ability of federal officers to protect their identities and do their jobs. The department also alleged that these limits threaten officers’ safety and hinder enforcement of federal law. It said officers have faced harassment, doxxing (publishing personal information online) and violence.

Associate Attorney General Stanley E. Woodward, Jr. said the injunction confirms that states cannot regulate the federal government or direct how federal officers do their duties. Acting Assistant Attorney General Jonathan D. Guynn of the Civil Division said the federal government, not the states, decides what equipment officers may use and what steps they may take to protect themselves.

The release did not describe the terms of the parties’ resolution or say what California’s position was. It did not say what each of the four laws requires. It also did not give the date the judge entered the order. The department said the order can be viewed through a link in its release.

The department said Attorney General Blanche has directed the Civil Division to look for state and local laws, along with policies and practices, that enable breaches of federal law or obstruct lawful federal operations. Guynn said the department will continue to challenge state and local laws that it says unlawfully regulate federal operations.