© Font et al. Light-operated drugs constitute a major target in drug discovery, since they may provide spatiotemporal resolution for the treatment of complex diseases (i.e. chronic pain). JF-NP-26 is an inactive photocaged derivative of the metabotropic glutamate type 5 (mGlu5) receptor negative allosteric modulator raseglurant. Violet light illumination of JF-NP-26 induces a photochemical reaction prompting the active-drug’s release, which effectively controls mGlu5 receptor activity both in ectopic expressing systems and in striatal primary neurons. Systemic administration in mice followed by local light-emitting diode (LED)-based illumination, either of the thalamus or the peripheral tissues, induced JF-NP-26-mediated light-dependent analgesia both in neuropathic and in acute/tonic inflammatory pain models. These data offer the first example of optical control of analgesia in vivo using a photocaged mGlu5 receptor negative allosteric modulator. This approach shows potential for precisely targeting, in time and space, endogenous receptors, which may allow a better management of difficult-to-treat disorders.