To explore the influence of hypophosphatemia on weaning from mechanical ventilation. An observational study was conducted. The medical records of 30 mechanical ventilated patients with hypophosphatemia admitted to intensive care unit of Sun Yat-sen Memorial Hospital of Sun Yat-sen University from January 2018 to August 2020 were analyzed; another 60 mechanical ventilated patients with normophosphatemia around the same time were enrolled as controls by 1:2 case-control matching based on gender, age, acute physiology and chronic health evaluation II (APACHE II) score, sequential organ failure assessment (SOFA) score. And then the duration of invasive mechanical ventilation, times of spontaneous breathing trial (SBT), the diaphragmatic ultrasonography movement indexes, and outcome of weaning and prognosis during hospitalization were compared between the two groups. Receiver operator characteristic curve (ROC curve) was plotted to calculate the areas under ROC curve (AUC) and cut-off values of serum phosphorus for successful weaning and hospital survival. The correlations between the diaphragmatic ultrasonography movement indexes and serum phosphorus were analyzed by Pearson partial correlation analysis. Compared with normophosphatemic group, the duration of invasive mechanical ventilation in hypophosphatemia group was significantly longer [days: 13.0 (7.0, 22.0) vs. 10.0 (5.5, 14.0), P < 0.05], and SBT attempts were more often [times: 3 (0, 5) vs. 1 (1, 2), P < 0.01], while the rate of successful weaning was lower (53.3% vs. 91.7%, P < 0.01), and the hospital mortality was higher (20.0% vs. 1.7%, P < 0.01). ROC curve analysis showed that serum phosphorus could predict successful weaning of mechanical ventilated patients, the AUC was 0.795, and the optimum cut-off value of serum phosphorus was 0.85 mmol/L with sensitivity of 73.2% and specificity of 84.2%. Serum phosphorus could predict hospital survival of mechanical ventilated patients, the AUC was 0.782, and the optimum cut-off value of serum phosphorus was 0.48 mmol/L with sensitivity of 81.9% and specificity of 85.7%. Compared with normophosphatemic group, diaphragm thickness at the end of inspiration (DTei), diaphragm thickness at the end of expiration (DTee), diaphragm thickening fraction (DTF), diaphragm excursion (DE) in hypophosphatemia group were all significantly decreased [DTei (cm): 0.19±0.07 vs. 0.27±0.08, DTee (cm): 0.14±0.05 vs. 0.19±0.06, DTF: (33.55±16.17)% vs. (45.04±18.66)%, DE (cm): 1.17±0.49 vs. 2.28±0.69, all P < 0.01]. Pearson partial correlation analysis showed that linear correlations were found between serum phosphorus and DTei, DTee, DTF, DE (r values were 0.442, 0.351, 0.293, 0.628 respectively, all P < 0.01). Serum phosphorus may have correlation with the diaphragmatic ultrasonography movement indexes. Hypophosphatemia may impair the contractile properties of diaphragm, induce more SBT attempts and longer duration of invasive mechanical ventilation, and affect outcome of weaning and prognosis.