Abstract An important goal of marine population genetics is to understand how spatial connectivity patterns are influenced by historical and evolutionary factors. In this study, we evaluate the demographic history and population structure of Littoraria flava, a highly dispersive marine gastropod in the Brazilian intertidal zone. To test the hypotheses that the species has (1) historically high levels of gene flow on a macrogeographical spatial scale and (2) a distribution in rocky shores that consists of subpopulations, we collected specimens along the Brazilian coastline and combined different sets of genetic markers (mitochondrial DNA, ITS-2 and single nucleotide polymorphisms) with niche-based modelling to predict its palaeodistribution. Low genetic structure was observed, as well as high gene flow over long distances. The demographic analyses suggest that L. flava has had periods of population bottlenecks followed by expansion. According to both palaeodistribution and coalescent simulations, these expansion events occurred during the Pleistocene interglacial cycles (21 kya) and the associated climatic changes were the probable drivers of the distribution of the species. This is the first phylogeographical study of a marine gastropod on the South American coast based on genomic markers associated with niche modelling.