a, Schematic of the viral vector strategy and optical fiber placement for optogenetic silencing of pPVTD2R–NAc axon terminals in the 2AA task. b, Representative images from a mouse expressing Halo-mCherry in pPVTD2R neurons (left) and implanted with optical fibers in the NAc (right). c, Fiber placements (n = 8 mice per group). d-g, Avoidance rate (d), latency to avoid (e), freezing time during the CS (f) and ITI freezing (g) across all training sessions for both Ctl and Halo groups. h-k, Left: Optogenetic inhibition of pPVTD2R–NAc axon terminals persistently decreases avoidance rate (h), while increases latency to avoid (i) and freezing time during the CS (j) but has little effect on freezing time during the the ITI (k). Right: Normalization to Day 1 for each group. Two-way ANOVA followed by two-stage linear step-up procedure of Benjamini, Krieger and Yekutieli. Avoidance rate: F(2, 28) = 18.04; group comparisons, Halo, Day 1 vs Day 2 ***P < 0.001, Day 1 vs Day 3 ***P < 0.001. Latency to avoid: F(2, 28) = 5.63; group comparisons, Ctl, Day 1 vs Day 3 *P = 0.028; Halo, Day 1 vs Day 2 ***P < 0.001, Day 1 vs Day 3 ***P < 0.001. CS freezing: F(2, 28) = 1.45; group comparisons, Halo, Day 1 vs Day 2 *P = 0.049, Day 1 vs Day 3 **P = 0.0092. ITI freezing: F(2, 28) = 0.149. l, Linear regression of the changes in freezing behavior across test sessions as a function of changes in avoidance behavior. All data in figure shown as mean ± s.e.m.