Bone mass loss around prostheses is a major cause of implant failure, especially in postmenopausal osteoporosis patients. In osteoporosis, excess oxidative stress largely contributed abnormal bone remodeling. Melatonin, which is synthesized from the pineal gland, promotes osteoblast differentiation and bone formation and has effectively been used to combat oxidative stress. Thus, we determined if melatonin can inhibit oxidative stress to promote osteogenesis and improve bone mass around prostheses in osteoporosis. In this study, we observed that received melatonin at 50 mg/kg body weight significantly increased periprosthetic bone mass as well as implant fixation intensity in ovariectomized (OVX) rats. Meanwhile, it decreased the expression of oxidative stress markers (NAPDH oxidase 2 and cytochrome c) and enhanced expressing level of the formation markers of bones (alkaline phosphatase, osteocalcin, and osterix) around prostheses compared to that in the control group. Additionally, melatonin decreased hydrogen peroxide- (H2O2-) induced oxidative stress and restored the osteogenesis potential of MC3T3-E1 cells. Mechanistically, melatonin clearly increased mitochondrial sirtuin 3 (SIRT3) expression and decreased the ratio of acetylated superoxide dismutase 2 (AC-SOD2)/SOD2 compared to the H2O2 group. SIRT3 inhibition counteracted the protective effects of melatonin on oxidative stress and bone formation. Together, the results showed that melatonin ameliorated oxidative stress in mitochondrial via the SIRT3/SOD2 signaling pathway, thereby promoting osteogenesis, improving bone mass around the prostheses, and increasing initial stability. Thus, melatonin might be a suitable candidate to decrease the rate of implant failure and lengthen the lifespan of prostheses after total joint arthroplasty.