Methamphetamine (METH) dependence is frequently comorbid with HIV infection and both have been linked to alterations of brain structure and function. In a previous study, we showed that the brain volume loss characteristic of HIV infection contrasts with METH-related volume increases in striatum and parietal cortex, suggesting distinct neurobiological responses to HIV and METH (Jernigan et al., 2005). Functional magnetic resonance imaging (fMRI) has the potential to reveal functional interactions between the effects of HIV and METH. In the present study, 50 participants were studied in four groups: an HIV+ group, a recently METH-dependent group, a dually affected group, and a group of unaffected community comparison subjects. An fMRI paradigm consisting of motor sequencing tasks of varying levels of complexity was administered to examine blood oxygenation level dependent (BOLD) changes. Within all groups, activity increased significantly with increasing task complexity in large clusters within sensorimotor and parietal cortex, basal ganglia, cerebellum, and cingulate. The task complexity effect was regressed on HIV status, METH status, and the HIV×METH interaction term in a simultaneous multiple regression. HIV was associated with less complexity-related activation in striatum, whereas METH was associated with less complexity-related activation in parietal regions. Significant interaction effects were observed in both cortical and subcortical regions; and, contrary to expectations, the complexity-related activation was less aberrant in dually affected than in single risk participants, in spite of comparable levels of neurocognitive impairment among the clinical groups. Thus, HIV and METH dependence, perhaps through their effects on dopaminergic systems, may have opposing functional effects on neural circuits involved in motor programming.