Planning spatial paths through our environment is an important part of everyday life and is supported by a neural system including the hippocampus and prefrontal cortex. Here we investigated the precise functional roles of the components of this system in humans by using fMRI as participants performed a simple goal-directed route-planning task. Participants had to choose the shorter of two routes to a goal in a visual scene that might contain a barrier blocking the most direct route, requiring a detour, or might be obscured by a curtain, requiring memory for the scene. The participant's start position was varied to parametrically manipulate their proximity to the goal and the difference in length of the two routes. Activity in medial prefrontal cortex, precuneus, and left posterior parietal cortex was associated with detour planning, regardless of difficulty, whereas activity in parahippocampal gyrus was associated with remembering the spatial layout of the visual scene. Activity in bilateral anterior hippocampal formation showed a strong increase the closer the start position was to the goal, together with medial prefrontal, medial and posterior parietal cortices. Our results are consistent with computational models in which goal proximity is used to guide subsequent navigation and with the association of anterior hippocampal areas with nonspatial functions such as arousal and reward expectancy. They illustrate how spatial and nonspatial functions combine within the anterior hippocampus, and how these functions interact with parahippocampal, parietal, and prefrontal areas in decision making and mnemonic function.