BACKGROUND: Studies highlight the thalamus as a key region distinguishing early- from late-onset obsessive-compulsive disorder (OCD). While structural thalamic correlates with OCD onset age are well-studied, resting-state functional connectivity (rsFC) remains largely unexplored. This study examines thalamic subregional rsFC to elucidate pathophysiological differences in OCD based on different onset times. METHODS: The study comprised 85 early-onset OCD (EO-OCD) patients, 94 late-onset OCD (LO-OCD) patients, and 94 age- and sex-matched healthy controls (HCs). rsFC analysis was conducted to assess thalamic connectivity across seven subdivisions among the groups. RESULTS: Both EO-OCD and LO-OCD patients exhibited increased rsFC between the primary motor thalamus and the posterior central gyrus and between the thalamic premotor and the supplementary motor areas. EO-OCD patients showed significantly stronger rsFC between the prefrontal thalamus (Ptha) and the middle frontal gyrus (MFG) compared to both LO-OCD patients and HCs. In contrast, LO-OCD patients demonstrated reduced rsFC between the Ptha and the inferior parietal lobule (IPL) compared to EO-OCD patients and HCs. Additionally, the rsFC between the Ptha and both the MFG and IPL was negatively correlated with age of onset, with earlier onset linked to stronger connectivity. CONCLUSION: These findings reveal both shared and distinct thalamic connectivity patterns in EO-OCD and LO-OCD patients. Sensory-motor networks exhibiting thalamic hyperconnectivity are critical for the manifestation of OCD, regardless of age of onset. The frontal-parietal network and thalamic hyperconnectivity may present a compensatory mechanism in EO-OCD patients, while hypoconnectivity with the frontoparietal network may reflect a neural mechanism underlying LO-OCD.