Neuronal signals relevant for spatial navigation have been described in many species[1-12], however, a circuit-level understanding of how such signals interact to guide behaviour is lacking. Here we characterize a neuronal circuit in theDrosophilacentral complex that compares internally generated estimates of the fly's heading and goal angles--both encoded in world-centred, or allocentric, coordinates--to generate a body-centred, or egocentric, steering signal. Past work has argued that the activity of EPG cells, or "compass neurons"[2], represents the fly's moment-to-moment angular orientation, or heading angle, during navigation[13]. An animal's moment-to-moment heading angle, however, is not always aligned with its goal angle, i.e., the allocentric direction in which it wishes to progress forward. We describe a second set of neurons in theDrosophilabrain, FC2 cells[14], with activity that correlates with the fly's goal angle. Furthermore, focal optogenetic activation of FC2 neurons induces flies to orient along experimenter-defined directions as they walk forward. EPG and FC2 cells connect monosynaptically to a third neuronal class, PFL3 cells[14,15]. We found that individual PFL3 cells show conjunctive, spike-rate tuning to both heading and goal angles during goal-directed navigation. Informed by the anatomy and physiology of these three cell classes, we develop a formal model for how this circuit can compare allocentric heading- and goal-angles to build an egocentric steering signal in the PFL3 output terminals. Quantitative analyses and optogenetic manipulations of PFL3 activity support the model. The biological circuit described here reveals how two, population-level, allocentric signals are compared in the brain to produce an egocentric output signal appropriate for the motor system.