Objective This study was conducted to investigate the protective effect of melatonin against aflatoxin B1 (AFB1) cardiotoxicity by evaluating NOD-like receptor family pyrin domain containing protein 3 (NLRP3) signalling. Methods Four groups of five rats each were assessed: control group (vehicle only), two AFB1 (0.15 and 0.3 mg/kg)-treated groups, and a combined AFB1 (0.3 mg/kg) plus melatonin (5 mg/kg)-treated group. After 6 weeks of once-daily intragastric treatment, cardiac pathologic changes were observed under optical microscopy, and oxidative/antioxidative parameters were measured in myocardial homogenate. Cardiac tissue expression of NLRP3 and other important inflammasome components was also analysed. Results Compared with controls, increasing concentrations of AFB1 were associated with increased oxidative stress and caused myocardial structure damage. In addition, AFB1 dose-dependently activated the NLRP3 signalling pathway. All these indices were significantly ameliorated by combined AFB1 plus melatonin treatment versus high-dose AFB1 alone. Conclusion Melatonin may reduce NLRP3 inflammasome activation by inhibiting oxidative stress and thus protect against injury from AFB1-induced myocardial toxicity.