Stochastic effects from demographic processes and selection are expected to shape the distribution of genetic variation in spatially heterogeneous environments. As the amount of genetic variation is central for long-term persistence of populations, understanding how these processes affect variation over large-scale geographical gradients is pivotal. We investigated the distribution of neutral and putatively adaptive genetic variation, and reconstructed demographic history in the moor frog (Rana arvalis) using 136 individuals from 15 populations along a 1,700-km latitudinal gradient from northern Germany to northern Sweden. Using double digest restriction-site associated DNA sequencing we obtained 27,590 single nucleotide polymorphisms (SNPs), and identified differentiation outliers and SNPs associated with growing season length. The populations grouped into a southern and a northern cluster, representing two phylogeographical lineages from different post-glacial colonization routes. Hybrid index estimation and demographic model selection showed strong support for a southern and northern lineage and evidence of gene flow between regions located on each side of a contact zone. However, patterns of past gene flow over the contact zone differed between neutral and putatively adaptive SNPs. While neutral nucleotide diversity was higher along the southern than the northern part of the gradient, nucleotide diversity in differentiation outliers showed the opposite pattern, suggesting differences in the relative strength of selection and drift along the gradient. Variation associated with growing season length decreased with latitude along the southern part of the gradient, but not along the northern part where variation was lower, suggesting stronger climate-mediated selection in the north. Outlier SNPs included loci involved in immunity and developmental processes. K E Y W O R D S adaptive divergence, amphibians, divergent selection, genetic drift, range expansion, small populations 1 | INTRODUC TI ON Species with wide geographical distributions are powerful model systems for investigating how selection and neutral processes shape genetic and phenotypic variation across heterogeneousenvironments, which may be affected by both contemporary processes as well as the demographic history of populations. However, disentangling the relative role of these processes along spatial gradients is challenging because environmental, genetic and phenotypic variation often co-vary in the same direction. When dispersal