This study explores the relationship of immune dysfunction to the neuropsychological performance of i.v. drug users (IVDUs) infected with HIV-1. Ninety-seven HIV-positive and 45 HIV-negative former IVDUs on methadone maintenance were evaluated using neuropsychological measures, physical examinations, and measures of immune function, including absolute CD4 counts and beta 2 microglobulin (beta 2-M). There were no significant differences between the HIV-positive and HIV-negative subjects on any single neuropsychological domain. There was, however, a significant group difference on a composite indicator of neuropsychological impairment, with 32% of HIV-positive subjects demonstrating some degree of overall impairment compared with only 13% of HIV-negative subjects. HIV-positive subjects were then stratified according to the Centers for Disease Control (CDC) symptom groupings: group II, asymptomatic, n = 29; group III, lymphadenopathy, n = 30; and group IV A or C-2, symptomatic, non-AIDS, n = 38. There were no significant neuropsychological differences among the three CDC groups. The HIV-positive subjects were also stratified on absolute CD4 counts (< or = 200, 201-400, and > 400) and beta 2-M (> or = 5, 3-5, and < 3). Individuals with greater immune compromise (CD4, < 200, beta 2-M, > or = 5) were more impaired on measures of motor functioning. beta 2-M was found to be a better predictor than CD4 count of impaired neuropsychological performance. Furthermore, individuals with beta 2-M values > or = 5 have more than a threefold increase in the incidence of neuropsychological impairment than those with beta 2-M values < 3.0. These results suggest that beta 2-M may serve as a useful clinical marker for the development of neuropsychological impairment and that the risk of such impairment increases as the immune system weakens.