The neuronal processes underlying correct and erroneous problem solving were studied in strong and weak problem-solvers using functional magnetic resonance imaging (fMRI). During planning, the right dorsolateral prefrontal cortex was activated, and showed a linear relationship with the participants' performance level. A similar pattern emerged in right inferior parietal regions for all trials, and in anterior cingulate cortex for erroneously solved trials only. In the performance phase, when the pre-planned moves had to be executed by means of an fMRI-compatible computer mouse, the right dorsolateral prefrontal cortex was again activated jointly with right parahippocampal cortex, and displayed a similar positive relationship with the participants' performance level. Incorrectly solved problems elicited stronger bilateral prefrontal and left inferior parietal activations than correctly solved trials. For both individual ability and trial-specific performance, our results thus demonstrate the crucial involvement of right prefrontal cortex in efficient visuospatial planning.