Archaeological evidence indicates that pig domestication had begun by similar to 10,500 y before the present ( BP) in the Near East, and mitochondrial DNA ( mtDNA) suggests that pigs arrived in Europe alongside farmers similar to 8,500 y BP. A few thousand years after the introduction of Near Eastern pigs into Europe, however, their characteristic mtDNA signature disappeared and was replaced by haplotypes associated with European wild boars. This turnover could be accounted for by substantial gene flow from local European wild boars, although it is also possible that European wild boars were domesticated independently without any genetic contribution from the Near East. To test these hypotheses, we obtained mtDNA sequences from 2,099 modern and ancient pig samples and 63 nuclear ancient genomes from Near Eastern and European pigs. Our analyses revealed that European domestic pigs dating from 7,100 to 6,000 y BP possessed both Near Eastern and European nuclear ancestry, while later pigs possessed no more than 4% Near Eastern ancestry, indicating that gene flow from European wild boars resulted in a near-complete disappearance of Near East ancestry. In addition, we demonstrate that a variant at a locus encoding black coat color likely originated in the Near East and persisted in European pigs. Altogether, our results indicate that while pigs were not independently domesticated in Europe, the vast majority of human-mediated selection over the past 5,000 y focused on the genomic fraction derived from the European wild boars, and not on the fraction that was selected by early Neolithic farmers over the first 2,500 y of the domestication process.