BackgroundSub-Saharan Africa (SSA) continues to suffer high communicable disease burdens as its demographic transition (DT) proceeds. Although the consequent changes in population structures influence age-specific contact patterns relevant for transmission, the age distribution of immunity, and the disease burden, investigation of the potential of DT to affect infectious disease epidemiology in regions of SSA has hitherto been overlooked. With a substantial disease burden and complex epidemiology, hepatitis B virus (HBV) represents a prime example of an infection whose epidemiology may be significantly influenced by the DT.MethodsAn age-structured mathematical model for HBV in the Senegal and Gambia (SG) region was set within a demographic framework with varying vital rates mirroring the entire course of the DT there over 1850–2100, to investigate the effects of the DT on HBV epidemiology, with and without the combined action of vaccination. The model was run from its reconstructed ancien régime (old order) demo-epidemiologic equilibrium and calibrated against SG 1950 age-distribution estimates and Gambian pre-vaccination HBV age-prevalence data.ResultsThe model, which reproduced well demographic and HBV age-prevalence data, predicted a complex transition of HBV epidemiology over the course of the DT. This included a prolonged epoch of expansion alongside population growth and rejuvenation until 1990–2000, followed by a dramatic retreat, mainly reflecting projected fertility decline during the twenty-first century. This transitional pattern was mostly explained by the underlying demographically driven changes in horizontal transmission resulting from the changes in the age structure of the population. During 2000–2150 the HBV burden is predicted to decline by more than 70% even in the absence of vaccination.ConclusionsDemographic change alone may strongly affect HBV disease burden and shape HBV endemicity. The onset of the demographically driven decline in HBV prevalence, aligned with the expansion of HBV vaccination, forms a synergy potentially boosting effectiveness of control. Such a synergy currently appears to be presenting a “window of opportunity” facilitating HBV elimination which it would be important to exploit and which underlines the importance of taking demographic change into account when assessing the potential longer term impact of vaccination and other control measures.Electronic supplementary materialThe online version of this article (10.1186/s12916-018-1100-0) contains supplementary material, which is available to authorized users.