We aimed to examine whether hypertension status modified the association between sleep duration and stroke among middle‐aged and elderly population. This cross‐sectional study included 10 516 participants aged ≥45 years from the China Hypertension Survey study. Sleep duration and history of stroke were assessed by questionnaires. Multivariate logistic regression analyses, a generalized additive model (GAM) and smooth curve fitting (penalized spline method) and a two‐piecewise logistic regression models were performed to evaluate the association between sleep duration and stroke in different status of hypertension. 95% confidence interval (CI) for turning point was obtained by bootstrapping. Multiple logistic analyses showed that per 1 hour increase in sleep duration was associated with a 37% increased prevalence of stroke among participants without hypertension and associated with a 8% increased prevalence of stroke among hypertensive participants (without hypertension: odds ratio [OR] = 1.37, 95% CI 1.09‐1.71; with hypertension: OR = 1.08, 95% CI 0.95‐1.21; PInteraction = .029). The fully adjusted smooth curves presented a linear association between sleep duration and stroke among participants without hypertension, but a threshold, nonlinear association among hypertensive participants. The turning point for the curve was found at a sleep duration of 8 (95% CI 5‐9) h among hypertensive patients. The ORs (95% CIs) for stroke were 0.92 (0.79, 1.06) and 1.60 (1.23, 2.08) to the left and right of the turning point, respectively. In conclusion, we found a linear association between sleep duration and stroke among middle‐aged and elderly participants without hypertension, but a threshold, nonlinear association among hypertensive participants.