Previous observational studies have shown that obstructive sleep apnea (OSA) was associated with chronic kidney disease(CKD). Early diagnosis of OSA usually helps better prevent the occurrence of CKD. This cross-sectional investigation was conducted using data from the National Health and Nutrition Examination Survey, which was carried out between 2007 to 2008 and 2015 to 2016. Logistic regression model was employed to assess the impact of OSA on CKD. We did a mediation analysis to assess how much of the effect of OSA on CKD was mediated through mediators. Additionally, Mendelian randomization (MR) analysis assessed the causal link between OSA and various measures of renal impairment and possible mediators: obesity, hypertension and type 2 diabetes mellitus. In the cross-sectional study, the results of unadjusted model showed that participants with OSA had a higher risk of CKD compared to non-OSA (OR = 1.14, 95% confidence intervals [CI]: 1.01-1.28, P <
.05). In mediation analysis, the proportion of hypertension and obesity mediating the effect of OSA on CKD was 41.83% and 30.74%, respectively. Univariate MR analysis results showed that: genetically predicted OSA was associated with decreased estimated glomerular filtration ratecystatin c (eGFRcystatin c) level (OR = 0.997, 95% CI: 0.995-0.999, P <
.05), increased blood urea nitrogen (BUN) levels (OR = 1.023, 95% CI: 1.008-1.038, P <
.05), increased serum creatinine levels (OR = 1.010, 95% CI: 1.002-1.018, P <
.05), increased serum cystatin C levels (OR = 1.015, 95% CI: 1.005-1.026, P <
.05). Multivariable MR results showed that obesity mediated the causal effect of OSA on eGFRcystatin c, BUN levels and serum cystatin C levels. The cross-sectional study revealed a positive relationship between OSA and CKD, which was mediated by hypertension and obesity. The MR analysis suggest that OSA was associated with several measures of renal impairment, which was mediated by obesity. These findings may inform prevention and intervention strategies against CKD.