Detection of surrounding organisms in the environment plays a major role in the evolution of interspecies interactions, such as predator–prey relationships. Nematode-trapping fungi (NTF) are predators that develop specialized trap structures to capture, kill, and consume nematodes when food sources are limited. Despite the identification of various factors that induce trap morphogenesis, the mechanisms underlying the differentiation process have remained largely unclear. Here, we demonstrate that the highly conserved pheromone-response MAPK pathway is essential for sensing ascarosides, a conserved molecular signature of nemaotdes, and is required for the predatory lifestyle switch in the NTF Arthrobotrys oligospora. Gene deletion of STE7 (MAPKK) and FUS3 (MAPK) abolished nematode-induced trap morphogenesis and conidiation and impaired the growth of hyphae. The conserved transcription factor Ste12 acting downstream of the pheromone-response pathway also plays a vital role in the predation of A. oligospora. Transcriptional profiling of a ste12 mutant identified a small subset of genes with diverse functions that are Ste12 dependent and could trigger trap differentiation. Our work has revealed that A. oligospora perceives and interprets the ascarosides produced by nematodes via the conserved pheromone signaling pathway in fungi, providing molecular insights into the mechanisms of communication between a fungal predator and its nematode prey.