Adaptation to varying environments, leading to population divergence, is one of the key processes of natural selection. However, its effectiveness amidst ongoing gene flow remains controversial. Our study explores this phenomenon by focusing on a tapeworm parasite (Ligula intestinalis), which is capable of parasitising a wide spectrum of fish species, overcoming their immunological defence and having a highly pathogenic impact. We analysed the population genetic structure, the degree of gene flow, and the level of genomic divergence between sympatrically occurring parasites from different cyprinid fish hosts. Utilising genome-wide Single Nucleotide Polymorphisms (SNPs) and transcriptome data, we investigated whether individual host species impose selection pressures on the parasite populations. Genetic clustering analyses indicated a divergence between the parasites infecting breams and those in roaches, bleaks and rudds. Historical demography modelling suggested that the most plausible scenario for this divergence is isolation with continuous gene flow. Selection analysis identified 896 SNPs under selection, exhibiting higher nucleotide diversity and genetic divergence compared to neutral loci. Transcriptome profiling corroborated these results, revealing distinct gene expression profiles for the two parasite populations. An in-depth examination of the selected SNPs and differentially expressed genes revealed specific genes and their physiological functions, as candidates for the molecular mechanisms of immune evasion and, thus, for driving ecological speciation in the parasite. This study showcases the interplay between host specificity, population demography and disruptive selection in ecological speciation. By dissecting the genomic factors at play, we gain a better understanding of the mechanisms facilitating population divergence in the presence of gene flow.