Developing neural networks display spontaneous and correlated rhythmic bursts of action potentials that are essential for circuit refinement. In the spinal cord, it is poorly understood how correlated activity is acquired and how its emergence relates to the formation of the spinal central pattern generator (CPG), the circuit that mediates rhythmic behaviors like walking and swimming. It is also unknown whether early, uncorrelated activity is necessary for the formation of the coordinated CPG.Time-lapse imaging in the intact zebrafish embryo with the genetically encoded calcium indicator GCaMP3 revealed a rapid transition from slow, sporadic activity to fast, ipsilaterally correlated, and contralaterally anticorrelated activity, characteristic of the spinal CPG. Ipsilateral correlations were acquired through the coalescence of local microcircuits. Brief optical manipulation of activity with the light-driven pump halorhodopsin revealed that the transition to correlated activity was associated with a strengthening of ipsilateral connections, likely mediated by gap junctions. Contralateral antagonism increased in strength at the same time. The transition to coordinated activity was disrupted by long-term optical inhibition of sporadic activity in motoneurons and ventral longitudinal descending interneurons and resulted in more neurons exhibiting uncoordinated activity patterns at later time points.These findings show that the CPG in the zebrafish spinal cord emerges directly from a sporadically active network as functional connectivity strengthens between local and then more distal neurons. These results also reveal that early, sporadic activity in a subset of ventral spinal neurons is required for the integration of maturing neurons into the coordinated CPG network.