But a new study that tested this strategy found the assumption may have been wrong.
"It's a significant, disappointing finding," Francis Ndowa, coordinator of the sexually transmitted infections control team at the World Health Organization, said in an interview.
Ndowa was not connected to the research, published Friday in the medical journal The Lancet.
The finding may spark a rethinking of HIV prevention strategies in Africa, where controlling sexually transmitted diseases such as herpes is usually part of general AIDS prevention plans.
Researchers tracked more than 3,000 men and women infected with herpes in Africa, Peru and the United States. Roughly half were treated with aciclovir, an antiviral that stops herpes ulcers.
After a year and a half, the scientists found that 75 people out of the 1,581 who had been receiving aciclovir were later infected with HIV. Of the 1,591 people who received placebo pills, 64 contracted HIV.
In the trial, researchers chose participants who had herpes and who faced similar risks of getting AIDS. The study also questioned the participants during monthly visits about risky sexual behavior with their recent partners.
The study was paid for by the United States' National Institute of Allergy and Infectious Diseases, other U.S. government institutes, and by GlaxoSmithKline PLC, which sells aciclovir as Zovirax.
A small study in Tanzania last year also suggested that treating herpes didn't help reducing HIV susceptibility.
But that doesn't necessarily mean that the theory of treating herpes to avoid HIV is incorrect, experts said.
"It's probably likely that we need considerably more potent interventions than we have," Connie Celum, a professor of global health and medicine at the University of Washington who led the Lancet study, told The Associated Press.
Experts said there was a complex relationship between the two viruses that is still not entirely understood.
When herpes ulcers erupt, that draws white blood cells to the skin to fight the virus. Unfortunately, those white blood cells also have receptors for HIV.
Ndowa said it was possible that even without the telltale ulcers, herpes might have lingered while patients were taking the aciclovir, allowing HIV to gain a foothold.
In an accompanying commentary in the Lancet, Ronald H. Gray and Maria J. Wawer of Johns Hopkins University said it was questionable whether controlling sexually transmitted infectious could work to prevent HIV.
"It is time to reassess the hypothesis and to adjust prevention policy accordingly," they wrote.
But Ndowa and Celum said the strategy of fighting herpes to prevent AIDS might work, if a different dosage or more powerful drug was tried.
"We don't exactly know why this didn't work, but this approach still has potential," Ndowa said. "Maybe it was just too much to expect from a tablet taken twice a day that it could be effective against HIV."