Objectives: Individuals with attention-deficit/hyperactivity disorder (ADHD) often have heightened levels of anxiety, which has been associated with worse performance on working memory tasks. Knowledge of the neural pathways underlying the combined presence of ADHD and anxiety may aid in a better understanding of their co-occurrence. Therefore, we investigated how anxiety modulates the effect of ADHD severity on neural activity during a visuospatial working memory (VSWM) task. Methods: Neuroimaging data were available for 371 adolescents and young adults participating in the multicentre cohort study NeuroIMAGE (average age 17.1 years). We analysed the effects of ADHD severity, anxiety severity and their interaction on-task accuracy, and on neural activity associated with working memory (VSWM trials minus baseline), and memory load (high memory load trials minus low load trials). Results: Anxiety significantly modulated the relation between ADHD severity and neural activity in the cerebellum for the working memory contrast, and bilaterally in the striatum and thalamus for the memory load contrast. Conclusions: We found that ADHD with co-occurring anxiety is associated with lowered neural activity during a VSWM task in regions important for information gating. This fits well with previous theorising on ADHD with co-occurring anxiety, and illustrates the neurobiological heterogeneity of ADHD.