Disclosed herein are small molecule heterocyclic inhibitors of sepiapterin reductase (SPR), and prodrugs and pharmaceutically acceptable salts thereof. The Also featured are pharmaceutical compositions of the compounds and uses of these compounds for the treatment or prevention of pain (e.g., inflammatory pain, nociceptive pain, functional pain, and neuropathic pain).