A ventilator, for the automated ventilation of a patient, includes a breathing gas delivery unit, at least one volume flow sensor for detecting a volume flow of the breathing gas, at least one breathing gas sensor for detecting a carbon dioxide concentration in the breathing gas, at least one pressure sensor for detecting a pressure of the breathing gas, as well as at least one computer. The computer is configured to actuate the breathing gas delivery unit as a function of the detected pressure and of a preset desired pressure value. The computer is further configured to perform an adaptation of the desired pressure value and an adaptation of a ventilation rate as a function of the detected volume flow and as a function of the detected carbon dioxide concentration.