Teleost fishes exhibit an unrivaled diversity of reproductive patterns compared to other vertebrates, and the groupers (Epinephelidae) and seabasses (Serranidae) represent an extreme example of this diversity, because significant variations in sexual pattern, mating behavior, and reproductive anatomy occur among species in both families. For this research, I investigate these three aspects of the reproductive biology in five species of groupers from the eastern Pacific. I then combine my data with published results on the reproductive biology of other groupers and seabasses to describe taxonomic differences in these aspects and reconstruct their evolutionary history. Finally, I use a comparative phylogenetic approach to evaluate the evolutionary relationship between mating system characteristics (i.e., mating group structure and sperm competition) and sexual pattern. More specifically, I test whether evolutionary shifts in sexual pattern and, in particular the loss of sex change, were influenced by changes from paired to group spawning and associated increases in sperm competition among males. These analyses allow me to determine whether predictions of sex-allocation theory regarding the influence of mating behavior on sex allocation are congruent with fine-scale, evolutionary patterns of sex change within a resolved phylogeny. My results indicate that characteristics of the sexual pattern, mating behavior, and reproductive anatomy in both families are exceptionally labile. Evolutionary transformations in these features do not strictly follow taxonomic lines and remarkable changes have evolved in closely related species and genera. The most parsimonious phylogenetic reconstructions of the evolutionary history of sexual patterns indicate that protogynous hermaphroditism is the ancestral character state in both the Epinephelidae and the Serranidae, and other forms of hermaphroditism evolved secondarily from this state. Tests of correlated evolution showed that evolutionary transformations in sexual pattern from protogyny to gonochorism are correlated with transformations in mating group structure from paired to group spawning, and sperm competition is significantly higher in gonochoric species than protogynous species. These results suggest that the loss of sex change was influenced by changes from paired to group spawning and associated increases in sperm competition among males. More importantly, this research provides phylogenetic support for predictions of the size- advantage model and empirical evidence for the influence of sperm competition on sex allocation in animals