Background: Critical care transthoracic echocardiography (TTE) can quickly and accurately assess haemodynamic changes in ICU patients. However, it is not clear whether transthoracic echocardiography improves the prognosis of mechanically ventilated patients. In this study, we hypothesized that early critical care transthoracic echocardiography independently contributes to improvements in mortality in mechanically ventilated patients in the ICU.Methods: This was a retrospective study based on the Medical Information Mart for Intensive Care III (MIMIC-III) database and the eICU Collaborative Research Database (eICU-CRD). Patients undergoing mechanical ventilation for more than 48 hours were selected. The exposure of interest was early TTE. The primary outcome was in-hospital mortality. We used propensity score matching to analyse the association between early TTE and in-hospital mortality and sensitivity analysis, including the inverse probability weighting model and covariate balancing propensity score model, to ensure the robustness of our findings.Results: A total of 8862 patients undergoing mechanical ventilation were enrolled. The adjusted OR showed a favourable effect between the early TTE group and in-hospital mortality [MIMIC: OR 0.77, 95% CI (0.63–0.94), (P=0.01); eICU-CRD: OR 0.78, 95% CI (0.68–0.89), (P<0.01) ]. Furthermore, TTE was also associated with 30-day mortality in the MIMIC database [OR 0.74, 95% CI (0.6-0.92), P=0.01].Conclusions: Early application of critical care transthoracic echocardiography during mechanical ventilation is beneficial for improving in-hospital mortality. Further investigation with prospectively collected data is required to validate this relationship.