Slit is secreted by cells at the midline of the central nervous system, where it binds to Roundabout (Robo) receptors and functions as a potent repellent. We found that migrating mesodermal cells in vivo respond to Slit as both an attractant and a repellent and that Robo receptors are required for both functions. Mesoderm cells expressing Robo receptors initially migrate away from Slit at the midline. A few hours after migration, these same cells change their behavior and require Robo to extend toward Slit-expressing muscle attachment sites. Thus, Slit functions as a chemoattractant to provide specificity for muscle patterning.