Leptothorax ant colonies sort their brood in concentric annuli with the smallest items in the middle and the largest on the periphery. Such brood sorting is a prime example of collective structure formation by social insects. Its underlying mechanism, however, is still not understood. We tested the hypothesis that brood sorting has two phases: the phase of clustering, proposed earlier, is followed by a phase of spacing, when ants move brood items away in a random direction but in a type-specific way so that items of different brood types spread out to a different extent. We hypothesized that in phase 2, spacing, items of the smallest brood type spread out the least and end up in the centre, whereas items of the largest brood type spread out the most and end up on the periphery. We found two distinct phases in the direction of brood movement during brood sorting associated with nest emigration. In phase 1, ants moved brood items in the direction away from the nest entrance. This was the clustering phase. In phase 2, ants moved brood items in a random direction. This was the spacing phase. Ants moved smaller items for longer than larger items. This is consistent with the hypothesis that ants put down brood items as a function of their weight. The diffusion coefficient and the frequency of movement were different for different brood types. The measure of the average spread (root-mean-square displacement) for each brood type was consistent with their order from the centre to the periphery of the sorted brood structure. The process underlying this spread, however, could not be simple diffusion since the movements of different brood types are interdependent. We discuss the mechanisms that could underlie the switch between the two phases.