Human–carnivore conflict is one of the major challenges in the management of populations of large carnivores. Concerns include the increasing human population; habitat loss as a result of degradation and fragmentation of forest; and livestock predation as a result of a lack of natural prey, leading to retaliatory killings of wild carnivores. Conflicts may be further aggravated by occasional attacks that result in injury and loss of human life. The level of consumption of prey species by a predator is a benchmark to evaluate the scale of this conflict. We used a newly developed DNA-based diet analysis to study the prey profile of common leopards Panthera pardus in Ayubia National Park, Pakistan. The results suggest that the common leopard is a generalist predator, subsisting mainly on domestic animals. Based on the frequency of occurrence of prey items in 57 faecal samples, the diet of the leopard is dominated by domestic goat Capra hircus (64.9%), followed by domestic dog Canis lupus familiaris (17.5%) and cow Bos taurus (12.3%). Domestic animals (goat, dog, cow, water buffalo Bubalus bubalis, horse Equus caballus and sheep Ovis aries) occurred in 54 (95%) of the 57 samples. We recommend a two-step strategy to mitigate this conflict: (1) introducing incentives for increased acceptance of leopards among local communities in the vicinity of the protected area and (2) increasing the availability of wild prey. We hope that the results of this study will contribute to the survival of the leopard in Pakistan.