Divergent natural selection driven by competition for limited resources can promote speciation, even in the presence of gene flow. Reproductive isolation is more likely to result from divergent selection when the partitioned resource is closely linked to mating. Obligate symbiosis and host fidelity (mating on or near the host) can provide this link, creating ideal conditions for speciation in the absence of physical barriers to dispersal. Symbiotic organisms often experience competition for hosts, and host fidelity ensures that divergent selection for a specific host or host habitat can lead to speciation and strengthen pre-existing reproductive barriers. Here, we present evidence that diversification of a sympatric species complex occurred despite the potential for gene flow and that partitioning of host resources (both by species and by host habitat) has contributed to this diversification. Four species of snapping shrimps (Alpheus armatus, A. immaculatus, A. polystictus and A. roquensis) are distributed mainly sympatrically in the Caribbean, while the fifth species (A. rudolphi) is restricted to Brazil. All five species are obligate commensals of sea anemones with a high degree of fidelity and ecological specificity for host species and habitat. We analysed sequence data from 10 nuclear genes and the mitochondrial COI gene in 11-16 individuals from each of the Caribbean taxa and from the only available specimen of the Brazilian taxon. Phylogenetic analyses support morphology-based species assignments and a well-supported Caribbean clade. The Brazilian A. rudolphi is recovered as an outgroup to the Caribbean taxa. Isolation-migration coalescent analysis provides evidence for historical gene flow among sympatric sister species. Our data suggest that both selection for a novel host and selection for host microhabitat may have promoted diversification of this complex despite gene flow.