A model is proposed for the evolution of X-chromosome inactivation (XCI) in which natural selection initially favors the silencing of paternally derived alleles of X-linked demand inhibitors. The compensatory upregulation of maternally derived alleles establishes a requirement for monoallelic expression in females. For this reason, XCI is self-reinforcing once established. However, inactivation of a particular X chromosome is not. Random XCI (rXCI) is favored over paternal XCI because rXCI reduces the costs of functional hemizygosity in females. Once present, rXCI favors the evolution of locus-by-locus imprinting of X-linked loci, which creates an evolutionary dynamic in which different chromosomes compete to remain active.