A federal judge in California late Friday, Oct. 30, ordered the federal government to halt demands that state and local election officials separate ballots or refuse to count certain votes from people it alleges are not U.S. citizens. The order also bars threats of criminal prosecution against election officials for failing to comply with those demands.

U.S. District Judge Trina Thompson issued the ruling in a case brought Thursday by labor unions and other groups. Their lawsuit accused the Trump administration of using intimidation against California election workers and interfering with the administration of the midterm elections. The challenge concerned both federal demands over ballots and warnings that officials could face prosecution.

Thompson concluded that federal officials had likely breached a provision of the Voting Rights Act of 1965 that protects people who assist others in voting from intimidation, threats and coercion. She also found that the government's conduct exceeded its legal or constitutional authority. Her findings accompanied a temporary restraining order, rather than a final resolution of the lawsuit.

In explaining her decision, Thompson emphasized that voters must be able to exercise their rights without fear or intimidation. She said protecting that freedom was necessary to preserve participation and public confidence in elections. Although federal officials described their efforts as an attempt to prevent unlawful voting by noncitizens, she found that their actions were likely to disrupt election administration and deprive lawful voters of their rights.

The dispute follows Justice Department efforts this month to have mail ballots separated for roughly 20,000 people it alleges are not citizens. Federal officials have also suggested for months that election workers could be prosecuted if they failed to prevent noncitizens from voting. The lawsuit cited July threats to prosecute local election officials involving Harmeet Dhillon, the head of the department's Civil Rights Division, among its examples of allegedly unlawful conduct.

The temporary restraining order runs through Nov. 16, with another hearing scheduled for Nov. 13. Alongside its restrictions on prosecution threats and ballot separation demands, the ruling requires the Justice Department to notify the court about any pending applications for search warrants or subpoenas. CBS News said it had contacted the department for comment.

Friday's ruling followed a separate decision Wednesday rejecting the Justice Department's request to force California to set aside more than 20,000 ballots associated with alleged noncitizens. That decision cited constitutional principles assigning states authority over the administration of their elections. The Trump administration appealed.