CPAP treatment apparatus is disclosed having a controllable flow generator (34, 38, 40) operable to produce breathable gas at a treatment pressure elevated above atmosphere to a patient by a delivery tube (32) coupled to a mask (30) having connection with a patient's airway. A sensor (44, 50, 56, 58) generates a signal representative of patient respiratory flow, that is provided to a controller (54, 62, 64). The controller (54, 62, 64) is operable to determine the occurrence of an apnea from a reduction in respiratory airflow below a threshold, and if an apnea has occurred, to determine the duration of the apnea and to cause the flow generator (34, 38) to increase the treatment pressure. In one preferred form the increase in pressure is zero if the treatment pressure before the apnea exceeds a pressure threshold. Below the pressure threshold the increase in pressure is an increasing function of the duration of the apnea multiplied by the difference between the pressure threshold and the current treatment pressure.