Distinctive colour patterns in dogs are an integral component of canine diversity. Colour pattern differences are thought to have arisen from mutation and artificial selection during and after domestication from wolves but important gaps remain in understanding how these patterns evolved and are genetically controlled. In other mammals, variation at the ASIP gene controls both the temporal and spatial distribution of yellow and black pigments. Here, we identify independent regulatory modules for ventral and hair cycle ASIP expression, and we characterize their action and evolutionary origin. Structural variants define multiple alleles for each regulatory module and are combined in different ways to explain five distinctive dog colour patterns. Phylogenetic analysis reveals that the haplotype combination for one of these patterns is shared with Arctic white wolves and that its hair cycle-specific module probably originated from an extinct canid that diverged from grey wolves more than 2 million years ago. Natural selection for a lighter coat during the Pleistocene provided the genetic framework for widespread colour variation in dogs and wolves.