The basal ganglia including the subthalamic nucleus (STN) and substantia nigra pars reticulata (SNr) are involved in pain-related responses, but how they regulate pain processing remains unknown. Here, we identify a pathway, consisting of GABAergic neurons in the SNr (SNr) and glutamatergic neurons in the STN (STN) and the lateral parabrachial nucleus (LPB), that modulates acute and persistent pain states in both male and female mice. The activity of STN neurons was enhanced in acute and persistent pain states. This enhancement was accompanied by hypoactivity in SNr neurons and strengthening of the STN-LPB glutamatergic projection. Reversing the dysfunction in the SNr-STN-LPB pathway attenuated activity of LPB neurons and mitigated pain-like behaviors. Therefore, the SNr-STN-LPB pathway regulates pathological pain and is a potential target for pain management.