A method of operating a CPAP apparatus in which the interface pressure is controlled to rapidly drop at the start of expiration by an expiratory relief pressure (ERP) that is independent of instantaneous respiratory flow, following which the pressure rises to an inspiratory level at or shortly before the end of expiration, or at the onset of an expiratory pause, if any. The ERP is an increasing function of the inspiratory pressure. The expiratory pressure follows a template that is a function of the expected expiration time, the magnitude of the template being equal to the ERP. The current estimated proportion of expiration is determined by comparing the expiration time of the breath in progress to low-pass filtered expiratory durations measured for a number of the preceding breaths.