The thalamic reticular nucleus (TRN), the major source of thalamic inhibition, regulates thalamocortical interactions that are critical for sensory processing, attention and cognition1-5. TRN dysfunction has been linked to sensory abnormality, attention deficit and sleep disturbance across multiple neurodevelopmental disorders6-9. However, little is known about the organizational principles that underlie its divergent functions. Here we performed an integrative study linking single-cell molecular and electrophysiological features of the mouse TRN to connectivity and systems-level function. We found that cellular heterogeneity in the TRN is characterized by a transcriptomic gradient of two negatively correlated gene-expression profiles, each containing hundreds of genes. Neurons in the extremes of this transcriptomic gradient express mutually exclusive markers, exhibit core or shell-like anatomical structure and have distinct electrophysiological properties. The two TRN subpopulations make differential connections with the functionally distinct first-order and higher-order thalamic nuclei to form molecularly defined TRN-thalamus subnetworks. Selective perturbation of the two subnetworks in vivo revealed their differential role in regulating sleep. In sum, our study provides a comprehensive atlas of TRN neurons at single-cell resolution and links molecularly defined subnetworks to the functional organization of thalamocortical circuits.