The aim of this study is to investigate the role of estrogen receptor β (ERβ) in nonylphenol (NP) - induced depression - like behavior in rats and its impact on the regulation of the TPH2/5-HT pathway. In the in vitro experiment, rat basophilic leukaemia cells (RBL-2H3) cells were divided into the four groups: blank group, NP group (20 μM), ERβ agonist group (0.01 μM), and NP+ERβ agonist group (20 μM+0.01 μM). For the in vivo experiment, 72 adult male Sprague-Dawley rats were randomly divided into following six groups: the Control, NP (40 mg/kg) group, ERβ agonist (2 mg/kg, Diarylpropionitrile (DPN)) group, ERβ inhibitor (0.1 mg/kg, 4-(2-phenyl-5,7-bis(trifluoromethyl)pyrazolo[1,5-a]pyrimidin-3-yl) phenol (PHTPP)) group, NP+ERβ agonist (40 mg/kg NP + 2 mg/kg DPN) group, and NP+ERβ inhibitor (40 mg/kg NP + 0.1 mg/kg PHTPP) group, with 12 rats in each group. Each rat in drug group were given NP by gavage and/or received a single intraperitoneal injection of DPN 2 mg/kg or PHTPP 0.1 mg/kg. Both in vivo and in vitro, NP group showed a decrease in the expression levels of ERβ, tryptophan hydroxylase (TPH1), and tryptophan hydroxylase-2 (TPH2) genes and proteins, and reduced levels of DA, NE, and 5-hydroxytryptophan (5-HT) neurotransmitters. RBL-2H3 cells showed signs of cell shrinkage, with rounded cells, increased suspension and more loosely arranged cells. The effectiveness of the ERβ agonist stimulation exhibited an increase exceeding 60% in RBL-2H3 cells. The application of ERβ agonist resulted in an alleviation the aforementioned alterations. ERβ agonist activated the TPH2/5-HT signaling pathways. Compared to the control group, the NP content in the brain tissue of the NP group was significantly increased. The latency to eat for the rats was longer and the amount of food consumed was lower, and the rats had prolonged immobility time in the behavioral experiment of rats. The expression levels of ERβ, TPH1, TPH2, 5-HT and 5-HITT proteins were decreased in the NP group, suggesting NP-induced depression-like behaviours as well as disturbances in the secretion of serum hormones and monoamine neurotransmitters. In the NP group, the midline raphe nucleus showed an elongated nucleus with a dark purplish-blue colour, nuclear atrophy, displacement and pale cytoplasm. ERβ might ameliorate NP-induced depression-like behaviors, and secretion disorders of serum hormones and monoamine neurotransmitters via activating TPH2/5-HT signaling pathways.