Phasic dopamine (DA) release accompanies approach toward appetitive cues. However, a role for DA in the active avoidance of negative events remains undetermined. Warning signals informing footshock avoidance are associated with accumbal DA release, whereas depression of DA is observed with unavoidable footshock. Here, we reveal a causal role of phasic DA in active avoidance learning; specifically, optogenetic activation of DA neurons facilitates avoidance, whereas optical inhibition of these cells attenuates it. Furthermore, stimulation of DA neurons during presentation of a fear-conditioned cue accelerates the extinction of a passive defensive behavior (i.e., freezing). Dopaminergic control of avoidance requires endocannabinoids (eCBs), as perturbing eCB signaling in the midbrain disrupts avoidance, which is rescued by optical stimulation of DA neurons. Interestingly, once the avoidance task is learned, neither DA nor eCB manipulations affect performance, suggesting that once acquisition occurs, expression of this behavior is subserved by other anatomical frameworks. Our findings establish an instrumental role for DA release in learning active responses to aversive stimuli and its control by eCB signaling.