The capacity of music to soothe pain has been used in many traditional forms of medicine. Yet, the mechanisms underlying these effects have not been demonstrated. Here, we examine the possibility that the modulatory effect of music on pain is mediated by the valence (pleasant-unpleasant dimension) of the emotions induced. We report the effects of listening to pleasant and unpleasant music on thermal pain in healthy human volunteers. Eighteen participants evaluated the warmth or pain induced by 40.0, 45.5, 47.0 and 48.5 degrees C thermal stimulations applied to the skin of their forearm while listening to pleasant and unpleasant musical excerpts matched for their high level of arousal (relaxing-stimulating dimension). Compared to a silent control condition, only the pleasant excerpts produced highly significant reductions in both pain intensity and unpleasantness, demonstrating the effect of positive emotions induced by music on pain (Pairwise contrasts with silence: p's<0.001). Correlation analyses in the pleasant music condition further indicated that pain decreased significantly (p's<0.05) with increases in self-reports of music pleasantness. In contrast, the unpleasant excerpts did not modulate pain significantly, and warmth perception was not affected by the presence of pleasant or unpleasant music. Those results support the hypothesis that positive emotional valence contributes to music-induced analgesia. These findings call for the integration of music to current methods of pain control.