Recent negative focus on women's academic abilities has fueled disputes over gender disparities in the sciences. The controversy derives, in part, from women's relatively poorer performance in aptitude tests, many of which require skills of spatial reasoning. We used functional magnetic imaging to examine the neural structure underlying shifts in women's performance of a spatial reasoning task induced by positive and negative stereotypes. Three groups of participants performed a task involving imagined rotations of the self. Prior to scanning, the positive stereotype group was exposed to a false but plausible stereotype of women's superior perspective-taking abilities; the negative stereotype group was exposed to the pervasive stereotype that men outperform women on spatial tasks; and the control group received neutral information. The significantly poorer performance we found in the negative stereotype group corresponded to increased activation in brain regions associated with increased emotional load. In contrast, the significantly improved performance we found in the positive stereotype group was associated with increased activation in visual processing areas and, to a lesser degree, complex working memory processes. These findings suggest that stereotype messages affect the brain selectively, with positive messages producing relatively more efficient neural strategies than negative messages.