Daniel Barry for The New York Times

A judge on Friday morning halted enforcement of a New York State directive requiring that all health care workers be vaccinated for the seasonal flu and swine flu.

The temporary restraining order by the judge, Thomas J. McNamara, an acting justice of the State Supreme Court in Albany, comes amid a growing debate about the flu vaccine. On Friday afternoon, the State Department of Health vowed to fight the restraining order, saying that the authorities “have clear legal authority” to require vaccinations, and noted that state courts had upheld mandatory vaccinations of health care workers against rubella and tuberculosis. Justice McNamara scheduled a hearing for Oct. 30 on the three cases before him, involving the flu vaccine.

The state health commissioner, Dr. Richard F. Daines, through the State Hospital Review and Planning Council, issued a regulation on Aug. 13 ordering health care workers to be vaccinated by Nov. 30 or face fines.

Dr. Daines later explained the reasoning behind the vaccine, saying in a statement on Sept. 24:

Questions about safety and claims of personal preference are understandable. Given the outstanding efficacy and safety record of approved influenza vaccines, our overriding concern then, as health care workers, should be the interests of our patients, not our own sensibilities about mandates. On this, the facts are very clear: the welfare of patients is, without any doubt, best served by the very high rates of staff immunity that can only be achieved with mandatory influenza vaccination – not the 40-50 percent rates of staff immunization historically achieved with even the most vigorous of voluntary programs. Under voluntary standards, institutional outbreaks occur every flu season. Medical literature convincingly demonstrates that high levels of staff immunity confer protection on those patients who cannot be or have not been effectively vaccinated themselves, while also allowing the institution to remain more fully staffed.

Terence L. Kindlon, a lawyer for three nurses who sued the state, asserting that the order violated their civil rights, said the judge’s ruling was a victory. New York was the only state in the country to mandate vaccinations for health care workers, he said.

The nurses — Lorna Patterson, Kathryn Dupuis and Stephanie Goertz — work in the emergency room at Albany Medical Center, a regional trauma unit.

“These are not libertarians, they are not lefties, they are not right-wing lunatics,” Mr. Kindlon said of his clients in a phone interview on Friday. “They are health care professionals, and they think the vaccination is not going to be good for them. They have no confidence that either the seasonal flu vaccine or H1N1 vaccine is going to do any good for them.”

Justice McNamara consolidated the nurses’ suit with two other lawsuits, brought by the New York State Public Employees Federation and the New York State United Teachers Union, which also challenged the regulation.

Mr. Kindlon said of his clients: “They basically were being administratively ambushed. This regulation came out of the Health Department during the dog days of August. People weren’t aware of it until September. Then they were suddenly advised that the drop-dead rate for receiving the vaccination from the state was Nov. 30.”

The hospital imposed its own deadline — mid-October — for vaccinations for its employees, Mr. Kindlon said.

The state is all but certain to fight the lawsuits and seek enforcement of the mandate. At a legislative hearing on Tuesday, Dr. Guthrie Birkhead, a state deputy health commissioner, defended the mandate, saying, “Health care settings are no different than any other setting where vaccination is the most effective method of preventing influenza.”

In a statement on Friday afternoon, the State Department of Health noted that Justice McNamara’s order was only temporary. Officials said in a statement:

In two weeks the Department is scheduled to be in court, where we will vigorously defend this lawsuit on its merits. We are confident that the regulation will be upheld. The Commissioner of Health and the State Hospital Review and Planning Council have clear legal authority to promulgate the mandatory regulation. As one court said in a 1990 ruling rejecting a challenge to regulations requiring mandatory rubella vaccinations and annual tuberculosis testing for health care workers: “Hospitals . . . exist for the benefit of their patients. They exist to cure the sick. The Legislature of this State has charged the Commissioner of Health with the responsibility of making hospitals safe places to get well. These regulations are tailored to accomplish that end.”

The issue of mandatory vaccinations has divided health care workers and even experts.

The Public Employees Federation, which has about 5,000 members covered by the regulations, said it encouraged its members to be vaccinated against the flu but opposed making the vaccine a condition of employment.

The New York State Nurses Association has taken a similar position. The association “supports immunization as an effective way to reduce the risk of contracting the flu, but upholds the right of registered professional nurses to choose whether or not they wish to be vaccinated,” officials said in a statement, adding, “The association believes effective patient protection is achieved through an aggressive voluntary vaccination program, coupled with a comprehensive infection prevention plan that includes education, proper hygiene practices, and the appropriate use of personal protective equipment.”

Patricia Finn, a lawyer for Suzanne Field, a nurse from Poughkeepsie, N.Y., who has filed a lawsuit in State Supreme Court in Manhattan challenging the mandatory vaccinations, said on Friday that her case would proceed despite the Albany restraining order, but added about the temporary restraining order: