MSMS: a coalescent simulation program including recombination, demographic structure and selection at a single locus. Motivation: We have implemented a coalescent simulation program for a structured population with selection at a single diploid locus. The program includes the functionality of the simulator ms to model population structure and demography, but adds a model for deme- and time-dependent selection using forward simulations. The program can be used, e.g. to study hard and soft selective sweeps in structured populations or the genetic footprint of local adaptation. The implementation is designed to be easily extendable and widely deployable. The interface and output format are compatible with ms. Performance is comparable even with selection included. Availability: The program is freely available from along with manuals and examples. The source is freely available under a GPL type license.