Parasites are a major evolutionary force, driving adaptive responses in host populations. Although the link between phenotypic response to parasite-mediated natural selection and the underlying genetic architecture often remains obscure, this link is crucial for understanding the evolution of resistance and predicting associated allele frequency changes in the population. To close this gap, we monitored the response to selection during epidemics of a virulent bacterial pathogen, Pasteuria ramosa, in a natural host population of Daphnia magna. Across two epidemics, we observed a strong increase in the proportion of resistant phenotypes as the epidemics progressed. Field and laboratory experiments confirmed that this increase in resistance was caused by selection from the local parasite. Using a genome wide association study (GWAS), we obtained a genetic model in which two genomic regions with dominance and epistasis control resistance polymorphism in the host. We verified this model by selfing host genotypes with different resistance phenotypes and scoring their F1 for segregation of resistance and associated genetic markers. Applying the model to the dynamics of the field population revealed moderate changes in allele frequencies at the two resistance loci relative to the profound changes observed at the phenotypic level. This apparent discrepancy is explained by strong epistasis and dominance at the two resistance loci, which reduces the effect of selection on alleles at both loci. Such epistatic effects with strong fitness consequences in host-parasite coevolution are believed to be crucial in the Red Queen model for the evolution of genetic recombination.