Guidance of axons towards or away from the midline of the central nervous system during Drosophila embryogenesis reflects a balance of attractive and repulsive cues originating from the midline. Here we demonstrate that Slit, a protein secreted by the midline glial cells provides a repulsive cue for the growth cones of axons and muscle cells. Embryos lacking slit function show a medial collapse of lateral axon tracts and ectopic midline crossing of ventral muscles. Transgene expression of slit in the midline restores axon patterning. Ectopic expression of slit inhibits formation of axon tracts at locations of high Slit production and misdirects axon tracts towards the midline. slit interacts genetically with roundabout, which encodes a putative receptor for growth cone repulsion.