Throughout the history of the AIDS epidemic, a few lucky people have avoided infection despite being exposed again and again. Now, researchers are traveling back in evolutionary time to understand why some people are resistant – and in some cases virtually immune – to the AIDS virus.

Studies released this week and last year suggest that the roots of AIDS immunity extend back for centuries, long before the disease even existed. Our ethnic backgrounds and the illnesses suffered by our distant ancestors appear to play a crucial role in determining whether our genes will allow HIV to take hold in our bodies.

For now, the findings seem likely to inspire more raised eyebrows than cutting-edge drugs. But over time, the research into why some people don't get HIV may help doctors treat those who do. By understanding which genes help people fight off infection, "we might move to a time where we can make more refined decisions about timing or intensity of therapy. Now, it's like a glove where one size fits all," said Dr. Matthew Dolan, an AIDS specialist in the U.S. Air Force and co-author of a new AIDS genetics study in an online edition of the journal Science.

Genetic resistance to AIDS works in different ways and appears in different ethnic groups. The most powerful form of resistance, caused by a genetic defect, is limited to people with European or Central Asian heritage. An estimated 1 percent of people descended from Northern Europeans are virtually immune to AIDS infection, with Swedes the most likely to be protected. One theory suggests that the mutation developed in Scandinavia and moved southward with Viking raiders.

All those with the highest level of HIV immunity share a pair of mutated genes – one in each chromosome – that prevent their immune cells from developing a "receptor" that lets the AIDS virus break in. If the so-called CCR5 receptor – which scientists say is akin to a lock – isn't there, the virus can't break into the cell and take it over.

To be protected, people must inherit the genes from both parents; those who inherit a mutated gene from just one parent will end up with greater resistance against HIV than other people, but they won't be immune. An estimated 10 percent to 15 percent of those descended from Northern Europeans have the lesser protection.

Using formulas that estimate how long genetic mutations have been around, researchers have discovered that the mutation dates to the Middle Ages. (Similar research in mitochondrial DNA – passed along by women – has suggested that Europeans are all descended from seven Ice Age matriarchs.)

Why would the mutation stick around so long instead of giving up the ghost? Researchers initially thought the mutation provided protection against the bubonic plague that caused the Black Death in Europe. Those with the mutation would have lived longer and had more children while many of their neighbors died off. The fact that the genetic mutation also provided protection against HIV centuries later would just be a coincidence.

The plague scenario has been largely discarded in favor of another deadly scourge. "A disease like smallpox that has been continuous since that time ... is more likely," said Yale University professor of epidemiology Alison Galvani, who co-wrote a study about the possible smallpox link in 2003.

According to Galvani, while the plague came and went, smallpox stuck around well into the 20th century, providing even more incentive for a protective gene to live on: It would keep people alive generation after generation, instead of just during one brief epidemic.

There are other cases of genetic mutations affecting two diseases: People who inherit one of the two mutations necessary to develop sickle-cell anemia end up with extra resistance to malaria, said Dr. Donald Mosier, professor of immunology at The Scripps Research Institute in La Jolla, California.

Last February, Mosier co-wrote a report in the journal Nature that debunked the plague theory after researchers found that mice bred with the AIDS-protective gene mutation still got sick with the plague. Mosier's not quite sure smallpox deserves credit for extending the mutation's life either, however, and suspects that a less high-profile disease – diarrhea-causing dysentery – may be why the mutation has lived on.

Besides the Northern Europeans and Central Asians with the CCR5 receptor gene mutation, new research shows that members of several ethnic groups have another, less-powerful kind of AIDS resistance. In the Science study released this week, a large team of investigators report that people who have more copies of a specific gene end up with greater resistance to AIDS, in some cases significantly changing how they handle getting infected.

The researchers examined the number of copies of a gene known as CCL3L1 in 4,300 people – some HIV-positive, some HIV-negative. Those with the most copies of the gene – but only as compared with others in their ethnic group – had the most immunity to HIV. The HIV-positive people with the fewest gene copies got sick as much as 2.6 times faster than others who were infected.

More copies of the CCL3L1 gene appear to translate into more proteins known as cytokines, which guide immune cells by latching onto receptors – those cellular locks. The cytokines "tell inflammatory cells it's time to move and go somewhere," Mosier said. With more cytokines floating around gumming up the cellular keyholes, there are fewer locks for the AIDS virus to pick.

Compared with the almost-absolute protection afforded by the gene defects in Europeans, "the effect is not as complete, but the prevalence is much higher," said study co-author Dr. Sunil K. Ahuja, professor of medicine at the University of Texas and director of the Veterans Administration Center for HIV and AIDS in San Antonio.

What can scientists and doctors do with all this information? Doctors could potentially test AIDS patients to see if their genes make them especially vulnerable to progression of the disease, Ahuja said. "This hasn't happened yet, and we aren't there yet. But that would be some practical downstream value of the work we are doing."

Then there's the prospect that people will use genetic testing as a ticket to a carefree sex life. If you're naturally resistant to AIDS, why not dump the condoms and add a few notches to your bedpost?

The Scripps Research Institute's Mosier has gotten calls from curious citizens wondering about their genes. But don't go running to your nearest genetic laboratory just yet. For one thing, researchers aren't sure whether the protective genes both giveth and taketh away: Perhaps they make people more resistant to AIDS but also make them more vulnerable to other germs.

Then there's the pesky matter of the few people who have gotten infected with HIV even though they're supposed to be immune. "It's extremely rare," Mosier said, "but you don't want to tell people they'll be protected and then have them change their risk behavior and get exposed."

Film Raises Ire Over HIV Origins

Designer Virus Stalks HIV

'It's OK, I'm on the AIDS Pill'

HIV Rate Still Pretoria's Secret

Check yourself into Med-Tech