Hepatocellular carcinoma (HCC) is one of the most lethal human cancers worldwide because of its high incidence, its metastatic potential and the low efficacy of conventional treatment. Inactivation of apoptosis is implicated in tumour progression and chemotherapy resistance, and has been linked to the presence of endoplasmic reticulum stress. Melatonin, the main product of the pineal gland, exerts anti-proliferative, pro-apoptotic and anti-angiogenic effects in HCC cells, but these effects still need to be confirmed in animal models. Male Wistar rats in treatment groups received diethylnitrosamine (DEN) 50 mg/kg intraperitoneally twice/once a week for 18 weeks. Melatonin was given in drinking water at 1 mg/kg/d, beginning 5 or 12 weeks after the start of DEN administration. Melatonin improved survival rates and successfully attenuated liver injury, as shown by histopathology, decreased levels of serum transaminases and reduced expression of placental glutathione S-transferase. Furthermore, melatonin treatment resulted in a significant increase of caspase 3, 8 and 9 activities, polyadenosine diphosphate (ADP) ribose polymerase (PARP) cleavage, and Bcl-associated X protein (Bax)/Bcl-2 ratio. Cytochrome c, p53 and Fas-L protein concentration were also significantly enhanced by melatonin. Melatonin induced an increased expression of activating transcription factor 6 (ATF6), C/EBP-homologous protein (CHOP) and immunoglobulin heavy chain-binding protein (BiP), while cyclooxygenase (COX)-2 expression decreased. Data obtained suggest that induction of apoptosis and ER stress contribute to the beneficial effects of melatonin in rats with DEN-induced HCC.