A federal judge in San Francisco yesterday temporarily barred the Department of Homeland Security from carrying out new rules to crack down on employers of illegal immigrants, dealing a legal setback to a central part of the Bush administration’s effort to step up enforcement of the immigration laws.

The judge, Maxine M. Chesney of federal court for the Northern District of California, also ordered the Social Security Administration to suspend a mailing, scheduled to begin Wednesday, of some 140,000 letters to employers advising them that some of their employees’ Social Security information did not match the agency’s records. Illegal immigrants often apply for work with false Social Security numbers.

The mailings, known as no-match letters, were going to be accompanied by a two-page notice from the Homeland Security Department advising employers of the new rules, which give them 90 days to fire any employee who cannot show valid Social Security identification or risk civil and even criminal charges for knowingly hiring illegal immigrants. The rules were announced in August and were expected to take effect on Sept. 10. Judge Chesney scheduled a hearing on the matter for Oct. 1.

The ruling came in response to a lawsuit filed Wednesday by the A.F.L.-C.I.O., several California labor groups and the American Civil Liberties Union. The suit argues that because of errors in the Social Security Administration’s database, many American citizen and legal immigrant workers could be dismissed because of the new rules. The suit also claims the rules could lead to discrimination against Hispanic workers.