This article reviews the cell and molecular biology of human immunodeficiency virus (HIV), emphasizing the features that lead to opportunistic infection by organisms such as mycobacteria. Mycobacteria, especially M. avium complex and M. tuberculosis infections, are closely associated with HIV disease. HIV is a very small retrovirus and its high mutation rate leads to extremely variable viral populations, both within and between individuals. It is coated with glycoprotein 120 (gp120), which it uses to bind to and infect a range of CD4+ leukocytes, depending on the co-receptor specificity. T cell-tropic HIV strains tend to use the CXCR-4 chemokine receptor, while macrophage-tropic strains tend to use the CCR-5 chemokine receptor. Immunosuppression is induced in a number of ways. As well as frank depletion of virus-infected T cells, antigen-specific T cell clones can be selectively deleted by mechanisms such as defective antigen presentation by HIV-infected macrophages (activation-induced cell death). Changes in cytokine production in HIV infection are also proposed. All this leads to falling T cell counts, B cell dysregulation and macrophage dysfunction. Opportunistic infections exploit this immunosuppressed environment. Certain infections are prevalent, reflecting factors such as environmental exposure to pathogens, poor mucosal defences and subcellular interactions between HIV and, e.g. viral or mycobacterial infections. Opportunistic infection exacerbates immune destruction by HIV, producing a vicious cycle that is ultimately fatal.