In zebrafish there are two populations of motoneurons, primary and secondary, that are temporally separate in their development. To determine if midline cells play a role in the specification of these neurons, we analyzed both secondary and primary motoneurons in mutants lacking floor plate, notochord, or both floor plate and notochord. Our data show that the specification of secondary motoneurons, those most similar to motoneurons in birds and mammals, depends on the presence of either a differentiated floor plate or notochord. In the absence of both of these structures, secondary motoneurons fail to form. In contrast, primary motoneurons, early developing motoneurons found in fish and amphibians, can develop in the absence of both floor plate and notochord. A spatial correspondence is found between secondary motoneurons and sonic hedgehog-expressing floor plate and notochord. In contrast, primary motoneuronal specification depends on the presence of sonic hedgehog in gastrula axial mesoderm, the tissue that will give rise to the notochord. These results suggest that both primary and secondary motoneurons are specified by signals from midline tissues, but at very different stages of embryonic development.