Abstract Background Poor sleep quality pose significant public health challenges globally. The objective of this study is to investigate the association between sleep quality, duration and the risk of hypertension. Methods 284,250 adults from the UK Biobank (UKB) and 6,104 participants from the English Longitudinal Study of Ageing (ELSA) were analyzed. The exposures of interest were sleep quality and duration. Sleep quality was evaluated based on the number of healthy sleep behaviors (UKB cohort) or questionnaire adapted from the Jenkins Sleep Problems Scale (ELSA cohort). Participants were divided into three groups based on the assessment of sleep quality. Long sleep is characterized by a duration exceeding 8 hours, medium sleep ranges from 7 to 8 hours and short sleep denotes less than 7 hours of sleep. The primary endpoint was incident hypertension. Results In UKB cohort, participants with poor sleep quality showed significantly higher risk of hypertension compared those with healthy sleep quality (hazard ratio [HR] 1.276, confidence interval [CI] 1.21, 1.346). Short sleep duration (≤7h) was associated with an elevated hypertension risk in participants regardless of different sleep quality, and both short(≤7h) and prolonged sleep time (≥9h) were associated with an increased hypertension risk in the poor sleep quality group. Several factors were independently associated with a lower risk of hypertension, including appropriate sleep duration (7-8 hours per day), absence of frequent insomnia, no self-reported snoring(P<0.001). Associations between sleep quality and an increased risk of hypertension remained significant regardless of genetic susceptibility to hypertension (P for interaction= 0.067). Conclusions Poor sleep quality is associated with an elevated risk of hypertension. Adjusting sleep behavior to enhance sleep quality within a recommended range could be a promising strategy for mitigating the risk of hypertension.