a, b, The average threshold intensity of photostimulation that evokes close investigation (CI) is similar to that required to evoke mounting (b), but significantly lower than that required to evoke attack (a). Data represent ChR2-expressing Esr1cre/+ males that exhibited CI and attack (a, n = 12 per group) or CI and mounting (b, n = 9 per group) in a given test session. **P < 0.01; Mann–Whitney U-test. Data are mean ± s.e.m. n = number of animals. c, d, Raster plot from a test session with the same resident male, showing that activation of VMHvl Esr1+ neurons elicits mounting and/or attack towards a castrated male intruder, dependent upon the intensity of photostimulation. c, A raster plot illustrating the experiment shown in Supplementary Video 6. Mounting (green) was elicited in a ChR2-expressing Esr1cre/+ male towards an unreceptive intact female during photostimulation trials (blue bars; 30 s). Note that mounting was followed by attack (red) in the high intensity photostimulation trials (3.7 mW mm−2). d, A raster plot illustrating a shift in behavioural responses from mounting to attack towards a castrated male intruder dependent upon photostimulation intensity (see Fig. 4a for the behavioural shift towards a female intruder). Note that time line is not continuous at the breakage in the line under rasters.