Slit is secreted by midline glia in Drosophila and functions as a short-range repellent to control midline crossing. Although most Slit stays near the midline, some diffuses laterally, functioning as a long-range chemorepellent. Here we show that a combinatorial code of Robo receptors controls lateral position in the CNS by responding to this presumptive Slit gradient. Medial axons express only Robo, intermediate axons express Robo3 and Robo, while lateral axons express Robo2, Robo3, and Robo. Removal of robo2 or robo3 causes lateral axons to extend medially; ectopic expression of Robo2 or Robo3 on medial axons drives them laterally. Precise topography of longitudinal pathways appears to be controlled by a combination of long-range guidance (the Robo code determining region) and short-range guidance (discrete local cues determining specific location within a region).