The existing studies on the association between the decline in handgrip strength (HGS) and poor sleep are uncertain. This study aimed to evaluate the independent association between HGS and sleep quality assessed by global Pittsburgh Sleep Quality Index (PSQI) score in the middleaged and elderly population. Data were obtained from the Midlife in the United States (MIDUS) study, a longitudinal study including 1255 middleaged and elderly individuals. Linear regression and logistic regression analyses were performed to examine the association of HGS with global PSQI score. A total of 1142 (aged 42–84) individuals were included in this study. Their median age was 54.0 years old, and 496 of them were male. After fully controlling for confounding factors, including socio-demographic, hematologic and other relevant factors, linear regression analysis showed that HGS (− 0.024 [− 0.040–0.007], P = 0.004) was negatively associated with global PSQI score. Logistic regression analysis showed that lower HGS (0.574 [0.342–0.964], P = 0.002) was associated with poorer sleep quality (global PSQI score > 5). Sensitivity analysis furthermore showed that the association between lower HGS and poor sleep quality was not affected by hypnotics use. The results of this study showed that lower HGS was independently associated with poor sleep quality among middle-aged and elderly people from the United States. Future longitudinal and interventional studies are warranted to assess whether elevated HGS may improve sleep quality.