Background. Impaired spatial working memory (SWM) is a robust feature of schizophrenia and has been linked to the risk of developing psychosis in people with an at-risk mental state (ARMS). We used functional magnetic resonance imaging (fMRI) to examine the neural substrate of SWM in the ARMS and in patients who had just developed schizophrenia. Method. fMRI was used to study 17 patients with an ARMS, 10 patients with a first episode of psychosis and 15 age-matched healthy comparison subjects. The blood oxygen level-dependent (BOLD) response was measured while subjects performed an object-location paired-associate memory task, with experimental manipulation of mnemonic load. Results. In all groups, increasing mnemonic load was associated with activation in the medial frontal and medial posterior parietal cortex. Significant between-group differences in activation were evident in a cluster spanning the medial frontal cortex and right precuneus, with the ARMS groups showing less activation than controls but greater activation than first-episode psychosis (FEP) patients. These group differences were more evident at the most demanding levels of the task than at the easy level. In all groups, task performance improved with repetition of the conditions. However, there was a significant group difference in the response of the right precuneus across repeated trials, with an attenuation of activation in controls but increased activation in FEP and little change in the ARMS. Conclusions. Abnormal neural activity in the medial frontal cortex and posterior parietal cortex during an SWM task may be a neural correlate of increased vulnerability to psychosis.