The Justice Department said yesterday that employers can discriminate against AIDS victims without necessarily violating federal civil rights laws intended to prevent discrimination against the handicapped.

In a legal opinion released yesterday, Justice Department attorneys drew a distinction between "the disabling effects of the disease on its victims" and "the ability of the victims to spread the disease to others." The former constitutes a handicap subject to protection under the law, while the latter does not, according to the opinion.

Under this reasoning, it is illegal for an employer to fire an AIDS victim who is otherwise qualified for the job, if the decision is based on the "disabling physical effects of AIDS." But such a dismissal would be considered legal if it were prompted by fear of contagion, according to the legal opinion.

The ruling, issued at the request of the Department of Health and Human Services, will guide government agencies in dealing with discrimination complaints by AIDS victims, Justice Department officials said.

The argument is expected to have important ramifications in the growing legal debate over the rights of victims of acquired immune deficiency syndrome.

The decision drew sharp criticism from representatives of homosexual rights groups, who said the opinion would prompt increased discrimination against AIDS victims. They also said the ruling contradicted numerous statements from the Public Health Service that the AIDS virus is not communicable through casual contact in the work place.

The Justice Department's position is contained in a 49-page opinion drafted by Charles J. Cooper, an assistant attorney general, and made public yesterday.

The issue raised in the brief is whether the Rehabilitation Act of 1973 applies to AIDS victims. That act prohibits discrimination against the handicapped in any program or activity that receives federal funds.

Cooper, who is in charge of the department's Office of Legal Counsel, argued in his opinion that the act offers only limited protection to AIDS victims.

Cooper stressed that discriminating against AIDS victims on the basis of fear of spreading the disease could be permitted even if that fear of contagion were not rational.

"An employer . . . who makes hiring decisions based on an unreasonable concern about contagion is no different from an employer whose hiring decisions rest on any other unreasonable basis that lies outside . . . the act's limited reach," the Justice Department opinion stated.

Parts of the legal opinion's conclusions differ sharply from the Public Health Service's findings that AIDS is primarily a sexually transmitted disease and that there is no known risk of passing on the virus in offices, factories and other work settings.

While acknowledging these findings, Justice said it "has been suggested, however, that conclusions of this character are too sweeping" and that the state of medical knowledge about AIDS is still in a preliminary stage.

"Whatever the medical facts regarding transmissibility might be, a constellation of factors make it intuitively plausible that a person claiming fear of contagion genuinely discriminated on that basis, rather than by reason of handicap," the opinion said.

Lawyers familiar with the AIDS-in-the-work-place issue stressed that the Justice Department decision is of limited practical effect because it only applies to programs covered by the Rehabilitation Act.

The department's interpretation could also be rejected by courts that hear the mushrooming number of lawsuits brought by AIDS victims who have been fired from their jobs, the lawyers said.

More than 40 states and the District of Columbia have adopted their own laws preventing discrimination against the handicapped, and many lawyers believe these statutes would protect AIDS victims where the federal rules do not apply.

The issue of whether state and local laws would make up for the apparent absence of federal protections has not yet been tested in court. Legal experts yesterday said that the Justice Department opinion could be used by employers to argue against such a broad interpretation of the handicap laws.

"It would have been nice for the Justice Department to say that AIDS victims should be treated the same as cancer victims, say," said Kenneth Labowitz, an Alexandria attorney who has taken on a number of alleged AIDS discrimination cases.

"I think this is going to harden the position of employers and their lawyers, and it's going to make it much more difficult to deal with AIDS in a rational way," Labowitz added.

Jim Graham, director of the Whitman-Walker Clinic, a service center for Washington-area AIDS patients, criticized the Justice Department for issuing a message that contradicted that issued by the Public Health Service.

"I think some employers will hear the word that they can discriminate if they are afraid of catching the disease," said Graham, himself a lawyer. But, he added, "You don't catch AIDS that way."

As of yesterday, the Centers for Disease Control in Atlanta reported 21,915 cases of AIDS in the United States, resulting in 12,008 deaths. Government authorities predicted earlier this month that the number of AIDS victims could grow to 145,000 in five years.