There are increasing concerns related to the cardiotoxicity of doxorubicin in the clinical setting. Recently, melatonin has been shown to exert a cardioprotective effect in various cardiovascular diseases, including cardiotoxic conditions. In this study, we examined the possible protective effects of melatonin on doxorubicin‐induced cardiotoxicity and explored the underlying mechanisms related to this process. We found that in vitro doxorubicin treatment significantly decreased H9c2 cell viability and induced apoptosis as manifested by increased TUNEL‐positive cells, down‐regulation of anti‐apoptotic protein Bcl‐2, as well as up‐regulation of pro‐apoptotic protein Bax. This was associated with increased reactive oxygen species (ROS) levels and decreased mitochondrial membrane potentials (MMP). In vivo, five weeks of doxorubicin treatment significantly decreased cardiac function, as evaluated by echocardiography. TUNEL staining results confirmed the increased apoptosis caused by doxorubicin. On the other hand, combinational treatment of doxorubicin with melatonin decreased cardiomyocyte ROS and apoptosis levels, along with increasing MMP. Such doxorubicin‐melatonin co‐treatment alleviated in vivo doxorubicin‐induced cardiac injury. Western Blots, along with in vitro immunofluorescence and in vivo immunohistochemical staining confirmed that doxorubicin treatment significantly down‐regulated Yes‐associated protein (YAP) expression, while YAP levels were maintained under co‐treatment of doxorubicin and melatonin. YAP inhibition by siRNA abolished the protective effects of melatonin on doxorubicin‐treated cardiomyocytes, with reversed ROS level and apoptosis. Our findings suggested that melatonin treatment attenuated doxorubicin‐induced cardiotoxicity through preserving YAP levels, which in turn decreases oxidative stress and apoptosis.