SAN FRANCISCO (AP) _ A federal appeals court Wednesday ordered a teacher with AIDS reinstated, ruling for the first time that discrimination against AIDS victims is barred under civil rights laws protecting the handicapped.

''Although handicapped (Chalk) is otherwise qualified to perform his job within the meaning of the Rehabilitation Act of 1973,'' which among other things prohibits job discrimination against the physically handicapped, said the court.

The 3-0 ruling by a 9th U.S. Circuit Court of Appeals panel came in the case of Vincent Chalk.

Chalk, 43, had taught classes for the hearing-impaired in Orange County school for seven years before barred from the classroom by the county this fall because he had been diagnosed with AIDS in February.

The court, reversing a lower-court ruling, said medical evidence ''overwhelmingly indicates that the casual contact incident to the performance of (Chalk's) teaching duties in the classroom presents no significant risk of harm to others.''

''We will be pleased to have him back as soon as he wants to come back,'' Robert Peterson, county Department of Education superintendent, told the Orange County Register. ''We never did have any animosity for Chalk. We needed direction from another authority.''

The decision will have ''a tremendous impact throughout the country, because the court has said very clearly, given what we know about AIDS, it is improper to exclude or discriminate against any person with AIDS,'' said American Civil Liberties Union lawyer Paul Hoffman, one of Chalk's lawyers.

''There are tens of thousands of people out there, maybe hundreds of thousands, who are in Vince Chalk's position, fearful of losing their jobs,'' he said.

''This is going to offer those people a lot of protection and hope that they are going to be able to lead productive lives even when they have this terrible problem.''

Another lawyer for Chalk, Joel Loquvam, said he reached the teacher by telephone Wednesday in New Mexico. Chalk is ''very excited, can hardly wait to see his kids, his schoolchildren, and will go back to work Friday if he is able,'' Loquvam said.

Ronald Wenkart, an attorney for the Orange County Department of Education, said he did not know whether the ruling would be appealed. He said a decision should be reached by Thursday.

Chalk was diagnosed with AIDS after being hospitalized with pneumonia. His doctor cleared him to return to work in April; the county referred the question to its director of epidemiology and disease control, Dr. Thomas Prendergast, who reported in May that Chalk's presence in the classroom would not endanger students.

Chalk remained on leave until August, when his application to return to the classroom was rejected by the county.

U.S. District Judge William Gray of Los Angeles let the decision stand, ruling in September that he could not be absolutely certain the students were free of risk.

He cited a statement by one physician, cancer specialist Steven Armentrout of the University of California at Irvine, predicting doctors would discover currently unknown ways by which AIDS can be transmitted.

Chalk's lawyers offered statements from the American Medical Association, the federal Centers for Disease Control and other medical experts that there was a consensus in the medical community that the disease could not be spread by casual contact.

Medical experts have said AIDS is transmitted only through sexual intercourse, use of contaminated needles or blood, or to infants within the womb of a pregnant woman.

At the start of the fall term, Chalk was given a desk job and told to develop an AIDS education program for students, a task he said made it harder for him to cope with the psychological effects of the disease. He went back on leave last month.

''This man has been treated like a leper,'' Hoffman told the court in arguments last week. ''He will die within a relatively short time. For him, this semester, next semester ... that is his life's work.''

The decision was signed by Judges Cecil Poole and Otto Skopil. Judge Joseph Sneed wrote separately but agreed with the order.