Nowadays, the exclusive use of commercial anthelmintics for the treatment of gastrointestinal nematode infections in ruminants is less sustainable due to anthelmintic resistance, as well as the problem of drug residues in animal products and the environment. Therefore, an integrated therapeutic approach is needed, including the search for alternatives to synthetic anthelmintic drugs. The aim of this study was to evaluate the possibility of using the essential oil of peppermint (Mentha x piperita L.) in the control of gastrointestinal nematodes in sheep. For this purpose, the in vitro and in vivo anthelmintic efficacy of this oil and the toxic effects on the hosts were examined. In the in vitro egg hatch test, ovicidal activity varied from 21.0–90.3% depending on the concentration of essential oil used (0.0125, 0.025, 0.049, 0.195, 0.781, 3.125, 12.5, and 50 mg/mL). To some extent, anthelmintic efficacy was confirmed in the in vivo fecal egg count reduction test at a mean dose of 150 mg/kg, with an average reduction of nematode eggs of 26.9 and 46.0% at Days 7 and 14 after treatment, respectively. Furthermore, no toxic effects of applied oil were observed on sheep behavior, kidney, or liver function. The main compounds identified by gas chromatography–mass spectrometry analyzes were menthol (32.6%), menthone (22.0%), menthyl-acetate (10.0%), and isomenthone (9.39%). Due to their complex chemical compositions, numerous bioactive ingredients, and natural origin, herbal formulations represent a potentially valuable alternative for the control of gastrointestinal nematodes in sheep. In this context, the results of the present study showed that peppermint essential oil is one of the promising candidates. Further studies should be performed to collect more data on the safety profile of M. piperita EO in treated animals to find the most appropriate formulation for use in field conditions and to test it against resistant gastrointestinal nematode populations.