Where there is fire, there is smoke. Where there is smoke, there are toxic fumes rich in cancer-causing hydrocarbons.

This means that when our ancestors tamed fire over a million years ago, they began breathing in these toxins that filled up their smoky caves. Not an ideal situation, given that the ability to control and use fire marks a major milestone in human evolution.

So the question is, how did our ancestors — the Homo erectus, Neanderthals, and early Homo sapiens — survive once they had mastered the flame?

The answer may be found in a new paper published in the latest edition of the journal Molecular Biology and Evolution. According to the authors of the study, a genetic mutation may have helped modern humans — Homo sapiens — adapt to smoke exposure. The researchers also found that the lack of this mutation in the Neanderthals’ genome may have been a contributing factor in their eventual extinction.

“Modern humans are the only primates that carry this genetic mutation that potentially increased tolerance to toxic materials produced by fires for cooking, protection and heating,” the researchers from the Pennsylvania State University said in a statement. “The mutation may have offered ancient humans a sweet spot in effectively processing some of these toxins — such as dioxins and polycyclic aromatic hydrocarbons — compared to other hominins.”

According to the World Health Organization, polycyclic aromatic hydrocarbons — a class of chemicals that are produced when coal, oil or wood is burned — can mutate the DNA and cause cancer. The research suggests that a difference in the aryl hydrocarbon receptor, which regulates the body's response to polycyclic aromatic hydrocarbons, between modern humans, Neanderthals and other non-human primates may have made us more desensitized to certain smoke toxins.

“For Neanderthals, inhaling smoke and eating charcoal-broiled meat, they would be exposed to multiple sources of polycyclic aromatic hydrocarbons,” co-author Gary Perdew from the Pennsylvania State University said in the statement. “The evolutionary hypothesis is, if Neanderthals were exposed to large amounts of these smoke-derived toxins, it could lead to respiratory problems, decreased reproductive capacity for women and increased susceptibility to respiratory viruses among preadolescents, while humans would exhibit decreased toxicity because they are more slowly metabolizing these compounds.”

On the flip side, however, this mutation, which ensured our survival, may also have allowed modern humans to pick up a bad habit — smoking.

“Something happened, where we picked up this mutation and we all have it, that’s undeniable,” Perdew told the Guardian. “The question is why?”