a Schematic of light stimulation of and patch-clamp recording from glutamatergic LPBN neurons transfected with AAV-Cre-on-ChR2-eYFP in brain slices from VgluT2-ires-Cre mice. b Example patch-clamp recordings showing light stimulation-induced time-locked action potential firing in ChR2-expressing VgluT2 neurons in the LPBN. Blue bars indicate application of light stimuli (473 nm, 5 ms, ~5 mW) at 1 Hz (upper), 5 Hz (middle), and 20 Hz (lower). c Schematic of stereotaxic delivery of AAV carrying Cre-dependent ChR2 into the LPBN of VgluT2-ires-Cre mice (upper) and experimental design and timeline of the behavioral experiments (lower). d Illumination (473 nm, 20 Hz, 5-ms pulse width, ~5 mW) of the LPBN significantly decreases the paw-withdraw thresholds (PWT) in response to von Frey mechanical stimulation in Sham-operated mice transfected with ChR2-eYFP, but not in mice transfected with eYFP in VgluT2 LPBN neurons. e Illumination (473 nm, 20 Hz, 5-ms pulse width, ~5 mW) of the LPBN significantly decreases the latency of the thermal paw-withdraw response in the Hargreaves test in Sham-operated mice transfected with ChR2-eYFP, but not in mice transfected with eYFP in VgluT2 LPBN neurons. f Schematic of the real-time place avoidance (RTPA) test. g–j Representative tracks (g, i) and quantification of time spent in the preferred chamber (h, j) in the RTPA test before (Pre), during (Light), and immediately after (Post) laser illumination (473 nm, 20 Hz, 5-ms pulse width, ~5 mW) of the LPBN transfected with eYFP (g, h) or ChR2 (i, j) in Vgltu2-ires-Cre mice. All data are presented as mean ± s.e.m. and error bars represent s.e.m. ***P < 0.001 and ****P < 0.0001. See also Supplementary Table 1 for further statistical information. Source data are provided as a Source Data file.