Tetrabromobisphenol A (TBBPA) is a widely used industrial brominated flame retardant, which can endanger animal and human health, including cytotoxicity, endocrine disruption, reproductive toxicity and so on. Melatonin (MT) is a noteworthy free radical scavenger and an antioxidant to alleviate oxidative stress. To investigate the cytotoxic of TBBPA on swine testis cells (ST cells), as well as the antagonistic effect of MT, we established TBBPA exposure and MT antagonistic models, used flow cytometry and AO/EB staining methods to detect apoptosis and necroptosis, used DCFH-DA method to examine the content of reactive oxygen species (ROS) and investigated the expression of associated genes using RT-PCR and Western blot. According to our findings, TBBPA exposure induced cell death in ST cells. TBBPA increased ROS levels, thus increasing PTEN expression and decreasing PI3K and AKT expression. Apoptosis-related factors (Caspase-3, Bax, Cyt-c, and Caspase-9) and necroptosis-related factors (RIPK1, RIPK3, and MLKL) were considerably elevated, in addition to the reduced expression of BCL-2 and Caspase-8. We also found that MT inhibited apoptosis and necroptosis in TBBPA-induced ST cells and effectively resolved the abnormal expression of related signaling pathways. In summary, the above results indicate that MT alleviates the disorder of PTEN/PI3K/AKT signaling pathway via inhibiting ROS overproduction, thereby mitigating apoptosis and necroptosis caused by TBBPA. This research provides a theoretical basis for further understanding of the toxicity of TBBPA and the detoxification of MT against environmental toxics.