Opioid drugs are potent analgesics that carry the risk of respiratory side effects due to actions on μ-opioid receptors (MORs) in brainstem regions that control respiration. Substance P is encoded by the Tac1 gene and is expressed in neurons regulating breathing, nociception, and locomotion. Tac1-positive cells also express MORs in brainstem regions mediating opioid-induced respiratory depression. We determined the role of Tac1-positive cells in mediating the respiratory effects of opioid drugs. In situ hybridization was used to determine Oprm1 mRNA expression (gene encoding MORs) in Tac1-positive cells in regions regulating respiratory depression by opioid drugs. Conditional knockout mice lacking functional MORs in Tac1-positive cells were produced and the respiratory and locomotor responses to the opioid analgesic fentanyl were assessed using whole-body plethysmography. A tail immersion assay was used to assess the antinociceptive response to fentanyl. Oprm1 mRNA was highly expressed (>80%) in subpopulations of Tac1-positive cells in the preBötzinger Complex, nucleus tractus solitarius, and Kölliker-Fuse/lateral parabrachial region. Conditionally knocking out MORs in Tac1-positive cells abolished the effects of fentanyl on respiratory rate, relative tidal volume, and relative minute ventilation compared with control mice. Importantly, the antinociceptive response of fentanyl was eliminated in mice lacking functional MORs in Tac1-positive cells, whereas locomotor effects induced by fentanyl were preserved. Our findings suggest that Tac1-positive cells mediate the respiratory depressive and antinociceptive effects of the opioid fentanyl, providing important insights for the development of pain therapies with reduced risk of respiratory side effects.