Male circumcision cuts the risk of contracting HIV by between 50 and 60 percent as well as reducing the risk of other sexually transmitted infections like herpes and HPV.
Researchers at the Lance Price of the Translational Genomics Research Institute in Arizona and the George Washington University believe this could be due to alterations in the microbiome in the penis.
A year after the procedure, the number of anaerobic bacteria that thrives under the foreskin had dropped significantly. The number of aerobic bacteria had also increased slightly.
Researchers think either the anatomy of the circumcised penis could reduce the risk of infection, or that changes in the microbiome (the total amount of microbes, their genetic elements and their environmental interactions) results in protection.
They said it could also be a combination of the two.
Lance Price, one of the study authors, said: "The change in the communities is really characterised by the loss of anaerobes. It's dramatic.
"From an ecological perspective, it's like rolling back a rock and seeing the ecosystem change. You remove the foreskin and you're increasing the amount of oxygen, decreasing the moisture - we're changing the ecosystem."
The researchers compared samples from circumcised and uncircumcised men. The group included samples from before and a year after the procedure.
"There was a dramatic and significant change in the penis microbiome as a result of male circumcision," Price said. Men who had been circumcised had a significantly greater decline in bacteria load than the control group.
"From a public health perspective the findings are really interesting because some of these organisms that are decreasing could cause inflammation.
"We're used to thinking about how disrupting the gut microbiome can make someone more susceptible to an infection. Now we think maybe this disturbance [in the penile microbiome] could be a good thing - could have a positive effect."
While the role of penile microbiome in HIV contraction is unknown, the authors think that genital bacteria may affect how susceptible the penis is to sexually transmitted viral infections.
The high bacterial loads in men who are not circumcised could activate cells in the foreskin that prevents the body from fending off viruses like HIV. Instead, these cells deliver HIV particles to T-cells where they can initiate an infection, the scientists said.
Reducing bacteria levels in the penis could theoretically stop these cells from aiding the HIV virus.
Price said the study could lead to interventions to reduce infection without circumcision: "By potentially revealing the underlying biological mechanisms, [we] could reveal alternatives to circumcision that would have the same biological impact.
"In other words, if we find that it's a group of anaerobes that are increasing the risk for HIV, we can find alternative ways to bring down those anaerobes [to prevent HIV infection]."