The origin of the domestic dog includes the dog's genetic divergence from the wolf, its domestication, and the emergence of the first dogs. Genetic studies show that all ancient and modern dogs share a common ancestry and descended from an ancient, now-extinct wolf population - or closely related wolf populations - which was distinct from the modern wolf lineage. The dog's similarity to the extant grey wolf is the result of substantial dog-into-wolf gene flow, with the modern grey wolf being the dog's nearest living relative. An extinct Late Pleistocene wolf may have been the ancestor of the dog, with one study proposing that this Pleistocene wolf was closer in size to a village dog.