Understanding factors that limit gene flow through the landscape is crucial for conservation of organisms living in fragmented habitats. We analysed patterns of gene flow in Elater ferrugineus, an endangered click beetle living in old-growth, hollow trees in a network of rural avenues surrounded by inhospitable arable land. Using amplified fragment length polymorphism (AFLP) data, we aimed to evaluate if the landscape features important for the beetle's development are also important for its dispersal. By dividing the sampling area into 30 9 30 m cells, with each cell categorised into one of four classes according to its putative permeability for dispersing beetles, and by correlating matrices of genetic and landscape resistance distances, we evaluated which of the landscape models had the best fit with the observed kinship structure. Significant correlations between genetic and Euclidean distances were detected, which indicated that restricted dispersal is the main constraint driving differentiation between populations of E. ferrugineus. Out of 81 landscape models in total, 54 models yielded significantly weaker correlation between matrices of pairwise kinship and effective distances than the null model. Regression analysis pointed to avenues as having the highest and positive impact on the concordance between matrices of kinship and landscape distances, while open arable land had the opposite effect. Our study thus shows that tree avenues can function as efficient dispersal corridors for E. ferrugineus, highlighting the importance of saving such avenues to increase the connectivity among suitable habitat patches, thereby reducing the risk of local extinctions of E. ferrugineus as well as other saproxylic organisms.