Melatonin, primarily synthesized and secreted by the pineal gland, exerts multifaceted roles in reducing oxidative stress, regulating circadian rhythms, modulating immune functions, and ameliorating age-related cognitive impairments in mice through chronic administration. Recent research has demonstrated that a single melatonin dose can enhance learning and memory in mice. However, the precise mechanisms underlying melatonin's cognitive-enhancing properties remain elusive. In our study, we administered melatonin intraperitoneally, along with its MT1/MT2 receptor agonist, ramelteon. This treatment notably improved long-term memory performance in mice, as assessed through the Object Recognition Test (ORT). Western blot analysis revealed that phospho-CaMKIIα levels decreased in the hippocampus across all drug administration groups but increased in the lateral cortex in response to all treatments. Phospho-CaMKIIβ exhibited a decrease in the hippocampus within the ramelteon group and an increase in the lateral cortex within the melatonin groups. Additionally, phospho-ERK levels increased in the hippocampus within the ramelteon group and in the lateral cortex across all treatment groups after 30 minutes. Furthermore, phospho-CaMKIIβ decreased in the hippocampus across all drug administration groups after 2 hours. In the medial prefrontal cortex, we observed a decrease in phospho-CaMKIIβ levels within the melatonin group after 30 minutes, and an increase in phospho-ERK levels within the same group after 2 hours. Alongside these findings, we conducted a Y-maze test and observed that melatonin administration significantly enhanced working memory in mice. This indicates that a single melatonin dose may have a broad spectrum of memory-enhancing effects.