Accumulating evidences reveal that cellular cholesterol deficiency could trigger the onset of Alzheimer’s disease (AD). As a key regulator, 24-dehydrocholesterol reductase (DHCR24) controls cellular cholesterol homeostasis, which was found to be downregulated in AD vulnerable regions and involved in AD-related pathological activities. However, DHCR24 as a potential therapeutic target for AD remains to be identified. In present study, we demonstrated the role of DHCR24 in AD by employing delivery of adeno-associated virus carrying DHCR24 gene into the hippocampus of 5xFAD mice. Here, we found that 5xFAD mice had lower levels of cholesterol and DHCR24 expression, and the cholesterol loss was alleviated by DHCR24 overexpression. Surprisingly, the cognitive impairment of 5xFAD mice was significantly reversed after DHCR24-based gene therapy. Moreover, we revealed that DHCR24 knock-in successfully prevented or reversed AD-related pathology in 5xFAD mice, including amyloid-β deposition, synaptic injuries, autophagy, reactive astrocytosis, microglial phagocytosis and apoptosis. In conclusion, our results firstly demonstrated that the potential value of DHCR24-mediated regulation of cellular cholesterol level as a promising treatment for AD.Supplementary InformationThe online version contains supplementary material available at 10.1186/s40478-023-01593-y.