This paper presents a systematic approach to system identification and closed-loop control of end-tidal carbon dioxide partial pressure (PETCO2) in mechanically ventilated patients. An empirical model consisting of a linear dynamic system followed by an affine transform is proposed to derive a low-order and high-fidelity representation that can reproduce the positive and inversely proportional dynamic input-output relationship between PETCO2 and minute ventilation in mechanically ventilated patients. The predictive capability of the empirical model was evaluated using experimental respiratory data collected from 18 mechanically ventilated human subjects. The model predicted PETCO2 response accurately with a root-mean-squared error of 0.22 ± 0.16 mmHg and a coefficient of determination r2 of 0.81 ± 0.18 (mean ± SD) when a second-order rational transfer function was used as its linear dynamic component. Using the proposed model, a closed-loop control method for PETCO2 based on a proportional-integral (PI) compensator was proposed by systematic analysis of the system root locus. For the 18 mechanically ventilated patient models identified, the PI compensator exhibited acceptable closed-loop response with a settling time of 1.27 ± 0.20 min and a negligible overshoot (0.51 ± 1.17%), in addition to zero steady-state PETCO2 set point tracking. The physiologic implication of the proposed empirical model was analyzed by comparing it with the traditional multicompartmental model widely used in pharmacological modeling.