Objective To investigate the effect of resveratrol (RES) on ovarian function in mice and elucidate the potential mechanism involving miR-23a. Methods Thirty mice were randomly divided into control, premature ovarian failure (POF) model, and treatment (RES) groups, with n = 10 per group. The body weight and ovarian mass of the mice were measured, and the ovarian index was calculated. Hematoxylin and eosin staining was performed to observe pathological changes in mouse ovarian tissue. Real-time quantitative PCR and Western blotting were performed to measure the mRNA and protein levels of miR-23a, X-linked inhibitor of apoptosis protein(XIAP), and caspase-3 in the ovarian tissue. Results Compared with the control group, the POF group exhibited significant decreases in ovarian mass (P < 0.05), ovarian index (P < 0.05), number of primary follicles, and XIAP mRNA expression (P < 0.05), alongside significant increases in miR-23a and caspase-3 mRNA expression (P < 0.05) . Compared with the POF group, the RES group exhibited significant increases in the ovarian mass (P < 0.05), ovarian index (P < 0.05), number of primary follicles, and XIAP mRNA expression (P < 0.05), as well as significant decreases in miR-23a and caspase-3 mRNA expression (P < 0.05) . XIAP protein expression was significantly lower and caspase-3 protein expression was significantly higher in the POF group than in the control group (P < 0.05) . Conversely, XIAP protein expression was significantly higher and caspase-3 protein expression was significantly lower in the RES group than in the POF group (P < 0.05) . Conclusion RES exerts a protective effect on weakened ovarian function in mice, potentially mediated through its effect on miR-23a targeting the XIAP-caspase-3 signaling pathway.