Enterotoxigenic Escherichia coli (ETEC) F4ac is a major determinant of diarrhea and mortality in neonatal and young pigs. Susceptibility to ETEC F4ac is governed by the intestinal receptor specific for the bacterium and is inherited as a monogenic dominant trait. To identify the receptor gene (F4acR), we first mapped the locus to a 7.8-cM region on pig chromosome 13 using a genome scan with 194 microsatellite markers. A further scan with high density markers on chromosome 13 refined the locus to a 5.7-cM interval. Recombination breakpoint analysis defined the locus within a 2.3-Mb region. Further genome-wide mapping using 39,720 informative SNPs revealed that the most significant markers were proximal to the MUC13 gene in the 2.3-Mb region. Association studies in a collection of diverse outbred populations strongly supported that MUC13 is the most likely responsible gene. We characterized the porcine MUC13 gene that encodes two transcripts: MUC13A and MUC13B. Both transcripts have the characteristic PTS regions of mucins that are enriched in distinct tandem repeats. MUC13B is predicated to be heavily O-glycosylated, forming the binding site of the bacterium; while MUC13A does not have the O-glycosylation binding site. Concordantly, 127 independent pigs homozygous for MUC13A across diverse breeds are all resistant to ETEC F4ac, and all 718 susceptible animals from the broad breed panel carry at least one MUC13B allele. Altogether, we conclude that susceptibility towards ETEC F4ac is governed by the MUC13 gene in pigs. The finding has an immediate translation into breeding practice, as it allows us to establish an efficient and accurate diagnostic test for selecting against susceptible animals. Moreover, the finding improves our understanding of mucins that play crucial roles in defense against enteric pathogens. It revealed, for the first time, the direct interaction between MUC13 and enteric bacteria, which is poorly understood in mammals.