The importance of social and spatial structuring of wildlife populations for disease spread, though widely recognized, is still poorly understood in many host-pathogen systems. In particular, system-specific kin relationships among hosts can create contact heterogeneities and differential disease transmission rates. Here, we investigate how distance-dependent infection risk is influenced by genetic relatedness in a novel host-pathogen system: wild boar (Sus scrofa) and African swine fever (ASF). We hypothesized that infection risk would correlate positively with proximity and relatedness to ASF-infected individuals but expected those relationships to weaken with the distance between individuals due to decay in contact rates and genetic similarity. We genotyped 323 wild boar samples (243 ASF-negative and 80 ASF-positive) collected in north-eastern Poland in 2014–2016 and modelled the effects of geographic distance, genetic relatedness and ASF virus transmission mode (direct or carcass-based) on the probability of ASF infection. Infection risk was positively associated with spatial proximity and genetic relatedness to infected individuals with generally stronger effect of distance. In the high-contact zone (0–2 km), infection risk was shaped by the presence of infected individuals rather than by relatedness to them. In the medium-contact zone (2–5 km), infection risk decreased but was still associated with relatedness and paired infections were more frequent among relatives. At farther distances, infection risk further declined with relatedness and proximity to positive individuals, and was 60% lower among un-related individuals in the no-contact zone (33% in10–20 km) compared among relatives in the high-contact zone (93% in 0–2 km). Transmission mode influenced the relationship between proximity or relatedness and infection risk. Our results indicate that the presence of nearby infected individuals is most important for shaping ASF infection rates through carcass-based transmission, while relatedness plays an important role in shaping transmission rates between live animals.