Abstract Understanding how emotional states influence driving behavior is crucial for the development of advanced driver assistance systems that improve safety by flexibly adapting to the current state of the driver. However, studies on emotional effects on driving behavior have revealed heterogeneous results. This might reflect that emotion induction methods differed in the extent to which they distracted attention. In the present study, we investigated how positive and negative emotions affect driving behavior, and which of these effects are related to emotional effects on attention. We conducted a driving simulator study in which tonic states of anger, happiness and calmness were induced using a combination of autobiographical imagination and music. Participants completed two driving tasks which involved brake and gas reactions as well as tracking, and in which demands on dual tasking and selective attention were further varied. We found that emotions influenced driving behavior in these tasks in two ways. Emotions changed behavior either directly (e.g., by promoting aggressive driving), or indirectly by altering attentional effects on driving (e.g., by attenuating dual task costs). Our results demonstrate that emotional effects on driving are highly task-specific and crucially depend on attentional demands involved in the driving task and the emotion-inducing event.