The role of spontaneous pattern formation, the appearance of inhomogeneities that are not directly imposed by external forces, has not been closely examined in the context of the origin and maintenance of genetic diversity in wild populations. Using individual-based computer simulations, we demonstrated that such patterns form in spatially distributed species with local demes under disruptive selection. In our model systems, spatial patterns of genetic diversity arose and changed over time even in the context of a spatially homogenous environment. The spatial distribution and dynamics of the fittest genotypes were controlled by the movement of boundaries between domains of the different genotypes. The rate of diversity decay was dramatically slower than predicted by traditional models. Therefore, spontaneous pattern formation may lead to the maintenance of genetic diversity of a species in a contiguous habitat, despite reproductive mixing. Moreover, the diversity persisted significantly longer in larger habitats and habitats with irregular geographical features. Habitat structure was intimately linked to the preservation of genetic diversity. Spontaneous pattern formation should be considered along with other spatial effects in the design of conservation areas.