Landscape heterogeneity and the reconfiguration of host plant distributions as a consequence of Quaternary climate oscillations are suggested to play a determinant role in shaping the evolutionary history of herbivorous insects. The cactus moth, Cactoblastis cactorum, is a southern South American phytophagous insect specialized in the use of cacti as feeding and breeding resources. It can be found across broad latitudinal and longitudinal gradients feeding on diverse native Opuntia species as well as the exotic and cultivated species Opuntia ficus-indica. Using high-throughput sequence data for the nuclear genome and mitochondrial DNA sequencing, we investigated patterns of genomic variation of C. cactorum across its native distribution. We integrated a demographic modeling approach for inferring gene flow and divergence times between C. cactorum populations, within a landscape genomic framework, to test alternative spatially-explicit hypotheses of past and current population connectivity based on climatically suitable areas for the focal species and distributions of host plants. Regions currently exhibiting high genomic diversity were evaluated for congruence with areas where suitable climatic conditions remained stable from the last glacial maximum to the present. Results revealed significant population structure across the range of C. cactorum, that can be explained by the spatial configuration of persistently suitable environmental conditions and host plant ranges during interglacial and glacial periods. Moreover, genomic data supported a hypothesis of long-term habitat stability in the northern regions of the distribution that served as a refuge for C. cactorum, enabling the accumulation and maintenance of high levels of genetic diversity over time.