Tuberculosis caused by the Mycobacterium tuberculosis complex (MTBC) is a worlwide emergency. A better understanding of the epidemic success of MTBC in various settings is needed to inform control strategies. To this aim, we introduce timescaled haplotypic density (THD), a novel genotype analysis method based on kernel density estimation to derive correlates of epidemic success, endemicity and pathogen transmission between groups of patients over specific timescales. Using mycobacterial tandem repeat sequences as genetic markers, we investigated a retrospective multicentric cohort of 1,641 MTBC-infected patients from France, a low-prevalence country where MTBC cases are frequently imported from abroad. THDs with timescales of 20 and 200y were included in association analyses with pathogen and patient characteristics. From the pathogen standpoint, our results identify the ability to cause pulmonary (hence, transmissible) disease as a major driving force of long-term epidemic success, most notably in the Euro-American and Beijing MTBC lineages. THD discriminated isolates of the regional endemic background from those imported more recently, allowing to identify several socio-demographic factors, such as younger age and student status, independently associated with non-endemic MTBC infection. We also decipher how past contacts between French and foreign populations might have contributed to shape the population structure of MTBC strains currently circulating in French-native patients. Our results highlight a combined influence of contacts with Europe, Northern and Middle Africa over a 200y timescale, and a preeminent influence of contacts with Northern Africa over the more recent 20y timescale, in line with historical and epidemiological evidence. To conclude, we describe how the interplay of MTBC lineage specificities, host risk factors and past human migrations contribute to the large-scale population dynamics of MTBC in a low-prevalence setting. Our approach could be applied to other pathogens, allowing to leverage the increasing wealth of genotypic and clinical data available from infection surveillance databases.