Background: Dexmedetomidine is recommended for sedation in patients on mechanical ventilation. Whether age or ICU types could alter mortality in invasive mechanically ventilated patients with sepsis receiving dexmedetomidine is unknown.Methods: We included patients with sepsis receiving invasive mechanical ventilation from the Medical Information Mart for Intensive Care IV database. The exposure was intravenous dexmedetomidine administration during ICU stay. The primary outcome was 28-day mortality. The secondary outcomes were the length of ICU stay and liberation from invasive mechanical ventilation. Propensity score matching (PSM) and Cox proportional hazards regression were used to adjust for confounders and investigate any association. Restricted cubic spline models were used to evaluate potential nonlinear associations.Results: The pre-matched and propensity score-matched cohorts included 5,871 and 2016 patients, respectively. In the PSM cohorts, dexmedetomidine exposure was related to lower 28-day mortality (186 [17.7%] vs. 319 [30.3%]; p < 0.001). Patients receiving dexmedetomidine, regardless of whether they were younger (≤65 years; hazard ratio [HR], 0.31; 95% confidence interval [CI], 0.23–0.42; p < 0.001) or elderly (>65 years; HR, 0.65; 95% CI, 0.52–0.83; p < 0.001), was associated with lower 28-day mortality (61 [10.3%] vs. 168 [28.2%] for younger; 125 [27.2%] vs. 152 [33.0%] for elderly). Patients receiving dexmedetomidine was also associated with lower 28-day mortality (53 [12.6%] vs. 113 [26.5%] for surgical intensive care unit [SICU]; 133 [21.0%] vs. 206 [32.9%] for non-SICU) regardless of whether the first admission to the SICU (HR, 0.36; 95% CI, 0.25–0.50; p < 0.001) or non-SICU (HR, 0.50; 95% CI, 0.40–0.62; p < 0.001). Moreover, both dose and duration of dexmedetomidine administration were related to lower 28-day mortality than no dexmedetomidine in younger patients (p < 0.001), but it not statistically significant in elderly patients.Conclusion: Dexmedetomidine was associated with lower 28-day mortality in critically ill patients with sepsis receiving invasive mechanical ventilation, regardless of whether patients were younger or elderly, the first admission to the SICU or non-SICU.