We investigated the effect of melatonin on bisphenol A (BPA)-induced oxidative stress damage in testicular tissue and Leydig cells. Mice were gavaged with 50 mg/kg BPA for 30 days, and concurrently, were injected with melatonin (10 mg/kg and 20 mg/kg). Leydig cells were treated with 10 μmol/L of BPA and melatonin. The morphology and organ index of the testis and epididymis were observed and calculated. The sperm viability and density were determined. The expressions of melatonin receptor 1A and luteinizing hormone receptor, and the levels of malonaldehyde, antioxidant enzymes, glutathione, steroid hormone synthases, aromatase, luteinizing hormone, testosterone, and estradiol were measured. TUNEL assay was utilized to detect testicular cell apoptosis. The administration of melatonin at 20 mg/kg significantly improved the testicular index and epididymis index in mice treated with BPA. Additionally, melatonin promoted the development of seminiferous tubules in the testes. Furthermore, the treatment with 20 mg/kg melatonin significantly increased sperm viability and sperm density in mice, while also promoting the expressions of melatonin receptor 1A and luteinizing hormone receptor in Leydig cells of BPA-treated mice. Significantly, melatonin reduced the level of malonaldehyde in testicular tissue and increased the expression of antioxidant enzymes (superoxide dismutase 1, superoxide dismutase 2, and catalase) as well as the content of glutathione. Moreover, melatonin also reduced the number of apoptotic Leydig cells and spermatogonia, aromatase expression, and estradiol level, while increasing the expression of steroid hormone synthases (steroidogenic acute regulatory protein, cytochrome P450 family 17a1, cytochrome P450 17α-hydroxylase/20-lyase, and, 17β-hydroxysteroid dehydrogenase) and the level of testosterone. Melatonin exhibited significant potential in alleviating testicular oxidative stress damage caused by BPA. These beneficial effects may be attributed to melatonin’s ability to enhance the antioxidant capacity of testicular tissue, promote testosterone synthesis, and reduce testicular cell apoptosis.