Helminths of the genus Oesophagostomum cause enteric diseases and affect domestic animals such as pigs. The aim of this study was to explore the species composition and genetic diversity of Oesophagostomum spp. infecting pigs in close contact with humans in the state of Piauí, Brazil. Eighty-seven fecal samples were collected for parasitological tests and molecular analysis. Through microscopy, the overall positivity rate for strongyliform eggs was 81.6% among the pigs studied. Forty-two strongyliform egg samples were subjected to PCR and six cox1 sequences (637 bp) were identified for the genus Oesophagostomum. The sequences were identified as Oesophagostomum dentatum, O. quadrispinulatum and O. columbianum. In the phylogenetic tree and haplotype network, 89 sequences were separated into seven clusters, which also included reference sequences from GenBank. Oesophagostomum dentatum and O. quadrispinulatum were seen to be closely related species and formed a monophyletic group related to O. aculeatum. Oesophagostomum columbianum showed similarity with sequences from parasites infecting small ruminants and the clade was positioned closer to O. bifurcum. High interspecific diversity was found and intraspecific diversity varied according to the species. This was the first study to characterize Oesophagostomum DNA sequences obtained from pigs in Brazil.