Purpose Diaphragmatic impairment has been reported in obstructive sleep apnea-hypopnea syndrome (OSAHS) patients. However, the risk factors of diaphragmatic dysfunction are unclear. This study was conducted to evaluate the diaphragmatic function and to investigate impact factors of ultrasonographic changes of the diaphragm in OSAHS patients. Methods This cross-sectional study recruited 150 snoring patients. All patients were divided into the control group (AHI < 5/h, n = 20), the mild-to-moderate OSAHS group (5/h <= AHI <= 30/h, n = 61), and the severe OSAHS group (AHI > 30/h, n = 69). Diaphragmatic thickness at function residual capacity (T-FRC) and total lung capacity (T-TLC) were measured by two-dimensional ultrasound, and the diaphragmatic excursion during tidal and deep breath was measured by M-mode ultrasound. The diaphragmatic thickening fraction (TF) was calculated. Spearman analysis and multiple linear stepwise regression analysis were conducted to analyze the impact factors of diaphragmatic function. Results T-FRC in the control group, mild-to-moderate OSAHS group, and severe OSAHS group was 1.23 (1.10, 1.39) mm, 1.60 (1.43, 1.85) mm, and 1.90 (1.70, 2.25) mm; T-TLC was 2.75 (2.53, 2.93) mm, 3.25 (2.90, 3.55) mm, and 3.60 (3.33, 3.90) mm, and TF was 119.23% (102.94, 155.97), 96.55% (74.34, 119.11), and 85.29% (60.68,101.22). There were across-group significant differences in T-FRC, T-TLC, and TF (P < 0.05). The oxygen desaturation index was the influencing factor of T-FRC, T-TLC, and TF (P < 0.05). Conclusion The diaphragm is thickened and diaphragmatic contractility is decreased in OSAHS patients. Nocturnal intermittent hypoxia is a risk factor for diaphragmatic hypertrophy and impaired diaphragmatic contractility.