On each side of the midline of the Drosophila CNS, axons are organized into a series of parallel pathways. Here we show that the midline repellent Slit, previously identified as a short-range signal that regulates midline crossing, also functions at long range to pattern these longitudinal pathways. In this long-range function, Slit signals through the receptors Robo2 and Robo3. Axons expressing neither, one, or both of these receptors project in one of three discrete lateral zones, each successively further from the midline. Loss of robo2 or robo3 function repositions axons closer to the midline, while gain of robo2 or robo3 function shifts axons further from the midline. Local cues further refine the lateral position. Together, these long- and short-range guidance cues allow growth cones to select with precision a specific longitudinal pathway.