The prevalence of dementia around the world is increasing, and these patients are more likely to have cognitive impairments, mood and anxiety disorders (depression, anxiety, and panic disorder), and attention deficit disorders over their lifetime. Previous studies have proven that melatonin could improve memory loss, but its specific mechanism is still confused. In this study, we used invivo and invitro models to examine the neuroprotective effect of melatonin on scopolamine (SCOP)-induced cognitive dysfunction. The behavioral tests were performed. 18F-FDG PET imaging was used to assess the metabolism of the brain. Protein expressions were determined through kit detection, Western blot, and immunofluorescence. Nissl staining was conducted to reflect neurodegeneration. MTT assay and RNAi transfection were applied to perform the invitro experiments. We found that melatonin could ameliorate SCOP-induced cognitive dysfunction and relieve anxious-like behaviors or HT22 cell damage. 18F-FDG PET-CT results showed that melatonin could improve cerebral glucose uptake in SCOP-treated mice. Melatonin restored the cholinergic function, increased the expressions of neurotrophic factors, and ameliorated oxidative stress in the brain of SCOP-treated mice. In addition, melatonin upregulated the expression of silent information regulator 1 (SIRT1), which further relieved endoplasmic reticulum (ER) stress by decreasing the expression of phosphorylate inositol-requiring enzyme (p-IRE1α) and its downstream, X-box binding protein 1 (XBP1). These results indicated that melatonin could ameliorate SCOP-induced cognitive dysfunction through the SIRT1/IRE1α/XBP1 pathway. SIRT1 might be the critical target of melatonin in the treatment of dementia.