Updated

Taking an anti-HIV pill shortly before sex and for a few days afterward can help protect people against infection with the human immunodeficiency virus, according to researchers in France and Canada.

In 2012, the U.S. Food and Drug Administration approved the pill, known as Truvada, for so-called pre-exposure prophylaxis (PrEP) against HIV, the virus that causes AIDS. Uninfected individuals who take Truvada every day can cut their risk of getting HIV during sex by more than 90 percent, according to the U.S. Centers for Disease Control and Prevention (CDC).

In the ANRS IPERGAY trial, gay and bisexual men were randomly assigned to take Truvada "as needed" - instead of each day - or an inactive dummy pill. The group taking Truvada had an 86 percent reduction in new HIV infections, compared to people taking the placebo.

That phase of the trial ended in 2014, after which the researchers offered Truvada to all the participants.

After an average of about 18 months, the risk of HIV among the 362 participants fell 97 percent, compared to results with the dummy pill in the first phase of the study.

Dr. Jean-Michel Molina of Hopital Saint-Louis in Paris, one of the lead investigators, told Reuters Health he's amazed at how effectively this strategy prevents HIV.

More on this...

For the trial, people took two pills two to 24 hours before sex. They took one tablet 24 hours later, and another tablet 48 hours later. If they had continuous sexual activity, they were told to take a pill each day and a pill for the following two days after last having sex.

During the first part of the trial, there were 6.6 new infections per year among every 100 people taking the dummy pill, versus only 0.91 new infections per year among every 100 people using PrEP.

When everyone started using "on demand" PrEP, the rate of new infections fell even further, to 0.19 per 100 people per year.

Molina wasn't surprised that infection rates dropped when everyone began taking PrEP. "Participants knew the efficacy of on demand PrEP and were more inclined to use it as recommended," he said in an email.

Molina and colleagues reported Wednesday at AIDS 2016 in Durban, South Africa that only one person acquired an HIV infection in the last phase of the trial. The person had not taken PrEP in months and had no detectable levels of the drug in his blood at the time of his diagnosis.

"In France today, two thirds of people on PrEP use it on demand," said Molina. "I think it is an interesting alternative for people who did not want to commit to a daily pill."

The findings only apply to men who have sex with men, however. Molina said studies in other populations are in progress.

The researchers also reported that condom use fell in the last phase of the trial. The decrease was primarily among men who previously committed to using condoms.

Dr. Bruno Spire of INSERM in Marseille, France, who is also an investigator on the trial, said condoms were rarely used among participants in the trial and they were protected from HIV by PrEP.

Without condoms, people are still vulnerable to other infections, but those are largely treatable, he said. Also, he noted, rates of other sexually transmitted infections in the study remained relatively steady.

Spire told Reuters Health that it may be better to empower some people to decide when they need PrEP. For others, he said, it may be better to have the pill as part of their daily routine.

When the initial results of IPERGAY were announced last year, the CDC said in a statement that it "continues to recommend daily dosing of PrEP and urges people at substantial risk for HIV infection and their health care providers to continue to follow current CDC guidelines."

Spire added that the new results can't predict what would happen in real life, where people are taking the pills on their own and not in a trial.