Emergency treatment if you think you've been exposed to HIV
BMJ Group Medical Reference
If you think you may have been in contact with HIV (through sex or an injury at work, or because you injected drugs, for example), there are drugs you can take that may lower your chances of getting infected. You should get medical help immediately.
This type of treatment is called postexposure prophylaxis or PEP for short. The drugs used are antiretroviral drugs, the same drugs that are used for people who already have the infection. You have to take these drugs as soon as possible and preferably before 24 to 36 hours after sex or your accident. It may still be worth having PEP up to two weeks after you might have been exposed to HIV, but doctors are not sure how well this works. 
It is very difficult to do studies to see if drugs that slow down HIV stop people becoming infected. This is because it wouldn't be fair not to give someone treatment if doctors thought it might help. But one study of 31 health workers from the US and France suggests that taking drugs against HIV reduces the odds of becoming infected by 81 percent. 
The people in the study were all accidentally exposed to the virus through their work (for example, they were stuck by a needle). We don't know how well this treatment works if you've been exposed to HIV through sex. However, many genitourinary clinics do provide PEP for people who have had unprotected sex with a person known to be infected with HIV.
Typically you would take two nucleoside reverse transcriptase inhibitors (NRTIs) for four weeks.  (To read more about NRTIs, see Antiretroviral drugs). In some cases, you may have to take two, three, or more antiretroviral drugs to avoid being infected with the virus. This is because some strains of the virus may have become resistant to one of the earliest drugs used to treat HIV, called zidovudine (AZT).
For references related to HIV infection click here