Ontogenetic changes in the behavior, spatial distribution, or habitat use of a species are presumably adaptations to ecological forces that dlffer in their effect on various life stages. The New Zealand rock lobster Jasus edwardsii is one of several species of spiny lobster that exhibits dramatic ontogenetic shifts in sociality and spatia.1 distribution, and we tested whether such changes are adaptive. We first surveyed several natural populations of J. edwardsii to document size-speclfic differences in aggregation. To determine i f chemical cues discharged by conspecifics promote aggregation of certain ontogenetic stages, we tested the responsiveness of lobsters of 3 ontogenetic stages (early benth~c juvenile, juvenile, and subadult) to the chemical cues produced by conspecifics of different sizes. Finally, we tethered lobsters of different ontogenetic stages alone and in groups to test the effect of lobster size and aggregation on mortality. Our results offer compelling evidence that pre-reproductive J. edwardsii undergo an ontogenetic change in sociality that alters their spatial distribution and sunrival. Our field surveys show that J. edwardsii are solitary as early benthic juveniles and become social and aggregate as they grow larger. We then demonstrate, using laboratory experiments, that there is a sizespecific increase in the response of pre-reproductive J. edwardsii to the chemical cues of larger conspecifics which facilitates these ontogenet~c changes in aggregation. Finally, our tethering results confirm that this change in social condition is selectively advantageous: aggregation does not increase the survival of small lobsters, but larger lobsters survive better in groups. Thus, in this study we demonstrate the linkage between ontogenetic changes in the spatial distribution of a species, the behavioral process that creates the pattern, and the selective advantage conferred by these developmental changes.