The dynamics of populations and genotypes are tightly interlinked. We formulate a modelling framework, AMELIE that links the spatio-temporal dynamics of plant populations and genotypes. AMELIE is flexible in the description of life histories, reproductive systems, demographic and environmental stochasticity. It can incorporate alternative submodels for key demographic processes (including arbitrary pollen and seed dispersal kernels). Genotypes are characterized by the combination of two alleles at a bi-parentally inherited locus that may affect any demographic process. We use AMELIE to study how transgene spread from a genetically modified (GM) to a conventional forest depends on the demographic trait modified by the transgene, on transgene expression, and on the initial genotype of GM plants. Transgene spread strongly depends on the interplay between trait modification and transgene expression, which jointly define the ability of heterozygous plants to replace conventional ones. When examining two alternative measures for controlling transgene spread, we find that planting heterozygous GM plants initially reduces transgene spread, whereas transgene recessiveness has more long-term effects on gene flow. The results of this study thus have direct implications for the assessment and management of GM risks. The flexible framework for modelling population?genotype dynamics furthermore has various applications in conservation biology.