Bone cancer pain (BCP), which seriously affects the quality of life of patients, remains a clinically challenging problem. Hence, there is an urgent need to investigate new mechanisms and develop new therapeutics to relieve BCP. In the present study, we investigated the analgesic effect of melatonin on BCP and the underlying mechanisms. Male C57BL/6 mice were used to establish BCP models. We found that the levels of sirtuin 1 (SIRT1) and nucleus-high mobility group box-1 (HMGB1) were decreased, whilst the levels of HMGB1, cytoplasm-HMGB1 and inflammatory cytokines (TNF-α, IL-6, IL-1β) were increased in the spinal cord of BCP mice on days 7, 14 and 21 after implantation compared with the levels in sham mice. Intrathecal administration of melatonin dose-dependently increased values of PWMT and TWL compared with the BCP group. However, intrathecal administration of EX527 (a selective SIRT1 antagonist) reversed the analgesic effect of melatonin. Moreover, mice in the melatonin group exhibited an increase in SIRT1 and nucleus-HMGB1, whilst there was a decrease in HMGB1, cytoplasm-HMGB1, rage, acetyl-HMGB1 and inflammatory cytokines compared with those in BCP mice. EX527 also reversed these changes. Furthermore, SIRT1 physically interacted with HMGB1 in the BCP mice. In conclusion, intrathecal administration of melatonin attenuates BCP through SIRT1-dependent inhibition of HMGB1 translocation and inflammatory cytokines. Melatonin may be a promising drug for the clinical treatment of BCP.