Indiscriminate activation of opioid receptors provides pain relief but also severe central and intestinal side effects. We hypothesized that exploiting pathological (rather than physiological) conformation dynamics of opioid receptor-ligand interactions might yield ligands without adverse actions. By computer simulations at low pH, a hallmark of injured tissue, we designed an agonist that, because of its low acid dissociation constant, selectively activates peripheral μ-opioid receptors at the source of pain generation. Unlike the conventional opioid fentanyl, this agonist showed pH-sensitive binding, heterotrimeric guanine nucleotide-binding protein (G protein) subunit dissociation by fluorescence resonance energy transfer, and adenosine 3′,5′-monophosphate inhibition in vitro. It produced injury-restricted analgesia in rats with different types of inflammatory pain without exhibiting respiratory depression, sedation, constipation, or addiction potential.