Long-term studies can provide powerful insights into the relative importance of different demographic and environmental factors determining avian population dynamics. Here we use 23 years of capture–mark–recapture data (1981–2003) to estimate recruitment and survival rates for a Sand Martin Riparia riparia population in Cheshire, NW England. Inter-annual variation in recruitment and adult survival was positively related to rainfall in the sub-Saharan wintering grounds, but unrelated to weather conditions on the breeding grounds. After allowing for the effects of African rainfall, both demographic rates were negatively density-dependent: adult survival was related to the size of the western European Sand Martin population (probably reflecting competition for resources in the shared wintering grounds) while recruitment was related to the size of the local study population in Cheshire (potentially reflecting competition for nesting sites or food). Local population size was more sensitive to variation in adult survival than to variation in recruitment, and an increase in population size after 1995 was driven mainly by the impact of more favourable conditions in the African wintering grounds on survival rates of adults. Overwinter survival in this long-distance Palaearctic migrant is determined partly by the amount of suitable wetland foraging habitat in the sub-Saharan wintering grounds (which is limited by the extent of summer rainfall) and partly by the number of birds exploiting that habitat.