Government researchers said yesterday that a genetically engineered herpes vaccine has been developed that, at least in laboratory animals, can prevent the lasting infection that is the most feared aspect of the disease.

The experimental vaccine was directed against the common oral herpes virus that causes cold sores and other health problems in tens of millions of Americans. But National Institutes of Health scientists reported that it also appeared to offer protection against the sexually transmitted genital type of herpes that has struck in epidemic proportions in recent years.

"It has some promise in protecting against both types of herpes," Dr. Abner L. Notkins of the National Institute of Dental Research said. But he cautioned that the new findings are "only a first step toward developing a human vaccine."

Further animal studies of safety and effectiveness are needed before a human study can be attempted with the NIH vaccine, Notkins said. Should that occur, he estimated it would be an additional four or five years before a herpes vaccine might be marketable. Numerous research groups around the world are also working on herpes vaccines.

Notkins said the new research, to be published in the May 10 issue of Science magazine, is the "first major test" with a genetically engineered vaccine to demonstrate the feasibility of countering not only immediate herpes infections but the troublesome long-term, or latent, infections that are characteristic of viruses in the herpes family.

An infection with herpes simplex type 1, for example, may start with a cold sore or fever blister on the mouth. But when the virus enters the skin it can travel into a nerve cell, where it may stay for long periods, periodically flaring up into active infection. A similar situation may occur with the herpes simplex type 2 virus responsible for most cases of genital herpes.

Because vaccines are aimed at preventing infection, they must be administered before exposure to a virus; thus, a herpes vaccine would not cure those already afflicted. A new prescription drug, oral acyclovir, is being marketed to prevent repeated outbreaks of genital herpes, and studies are under way to test its effect on oral herpes.

Notkins said a herpes vaccine would be most useful if given to children.

Eighty to 90 percent of the adult population in the United States has been exposed to the oral herpes virus, but only a fraction come down with noticeable herpes infections. Notkins cited estimates that there are 50 million to 100 million recurrent episodes of oral herpes infection each year in the United States; genital herpes afflicts an estimated 5 million to 20 million Americans.

Oral and genital herpes outbreaks are generally not life-threatening, but can be painful and contagious. Herpes also can infect the eye and cause blindness, and in rare instances can lead to neurological problems. Newborns also may be seriously affected.

The experimental NIH vaccine tested by Notkins' group was tailor-made, using recombinant deoxyribonucleic acid techniques, by a team headed by Dr. Bernard Moss at the National Institute of Allergy and Infectious Diseases. The well-known vaccinia, or cowpox, virus that was successful against smallpox was used as a carrier for a specific herpes gene that can cause immunity.

When the hybrid virus was injected into mice, it reproduced and stimulated the production of high levels of herpes antibodies that provided nearly 100 percent protection when the animals were later given a heavy dose of herpes type 1 virus, Notkins said. In comparison, more than three-fourths of the nonvaccinated animals in the experiment died, he added.

Researchers obtained similiar results with the genital herpes virus -- an "added bonus," Notkins said.

In separate experiments to test whether the vaccine prevented the virus from invading nerve cells, the researchers found that two-thirds of the mice tested were protected from a latent herpes infection. It is not known why the other animals were not protected, but Notkins said it appears to be a question of whether the virus can reach the nerve ending before the antibody can attack it.

"The only way that question is ultimately going to be answered is to do human trials," he said.

Moss said other studies of the vaccinia virus are under way and might lead to a "multipurpose vaccine."