Drug and alcohol use complicate both the prevention and treatment of human immunodeficiency virus (HIV) infection. Substance use is one of the major engines driving HIV transmission, directly, through the sharing of injection drug use equipment and indirectly, through increasing risky sexual behaviors. Drug and alcohol dependence compromise effective HIV treatment by influencing both access and adherence to antiretroviral therapy. Exposure to addictive substances may have direct immunosuppressive effects independent of their impact on access and adherence to treatment. Measures effective at minimizing HIV transmission attributable to drug and alcohol use include HIV testing and referral to treatment, syringe and needle exchange programs, opioid replacement therapy (i.e., methadone and buprenorphine), and behavioral interventions targeting HIV risk behaviors among both HIV-infected and HIV-uninfected people. Measures effective at optimizing HIV treatment among alcohol and drug-dependent patients include HIV testing with referral to treatment and substance use treatment that is linked to or integrated into HIV treatment. Due to the intertwining problems of substance use and HIV infection, physicians and other health care providers must address the issues of illicit drugs and alcohol use as mainstream medical problems in order to provide optimal care for HIV-infected patients.