Understanding how biodiversity originates and is maintained are fundamental challenge in evolutionary biology. Speciation is a continuous process and progression along this continuum depends on the interplay between evolutionary forces driving divergence and forces promoting genetic homogenisation. Coral reefs are broadly connected yet highly heterogeneous ecosystems, and divergence with gene flow at small spatial scales might therefore be common. Genomic studies are increasingly revealing the existence of closely related and sympatric taxa within taxonomic coral species, but the extent to which these taxa might still be exchanging genes and sharing environmental niches is unclear. In this study, we sampled extensively across diverse habitats at multiple reefs of the Great Barrier Reef (GBR) and comprehensively examined genome‐wide diversity and divergence histories within and among taxa of the Stylophora pistillata species complex. S. pistillata is one of the most abundant and well‐studied coral species, yet we discovered five distinct taxa, with wide geographic ranges and extensive sympatry. Demographic modelling showed that speciation events have occurred with gene flow and that taxa are at different stages along a divergence continuum. We found significant correlations between genetic divergence and specific environmental variables, suggesting that niche partitioning may have played a role in speciation and that S. pistillata taxa might be differentially adapted to different environments. Conservation actions rely on estimates of species richness, population sizes and species ranges, which are biased if divergent taxa are lumped together. As coral reefs are rapidly degrading due to climate change, our study highlights the importance of recognising evolutionarily distinct and differentially adapted coral taxa to improve conservation and restoration efforts aiming at protecting coral genetic diversity.