Diaphragmatic dysfunction is a common problem in patients who have been mechanically ventilated. The study aimed to evaluate the effectiveness of inspiratory muscle training (IMT) on diaphragm muscle thickness and function in mechanically ventilated patients. A single-blind trial was conducted. Twenty patients were randomly assigned to either the conventional physiotherapy (CP) group or to the IMT group for 5 days following extubation. The CP group received only CP, while the IMT group received CP in addition to IMT. Ten healthy controls (HCs) underwent IMT. Maximum inspiratory pressure (MIP) and physical function were recorded. Diaphragm excursion (DE), diaphragm thickness at the end of inspiration (Tdi), diaphragm thickness at the end of expiration (Tde), peak contraction velocity (PCV), and peak relaxation velocity (PRV) were evaluated with ultrasonography before and after the intervention. The IMT group and HCs showed significant improvements in DE (p = 0.005; p = 0.005, respectively), PCV (p = 0.028; p = 0.015, respectively) and PRV (p = 0.029; p = 0.020, respectively) after 5 days of IMT. A significant increase in MIP was recorded in all groups after the intervention (CP: p = 0.044; IMT: p = 0.005; HC: p < 0.001). There was a significant improvement in the Medical Research Council (MRC) and the Physical Function in Intensive Care Test (PFIT) scores in both the CP and IMT groups (p < 0.001 and p < 0.001, respectively). Inspiratory muscle training improves diaphragmatic functions, including MIP, diaphragm excursion, PCV, and PRV. We think that IMT applied after extubation may serve as a tool to prevent and facilitate the recovery of diaphragmatic function.