An apparatus for extracorporeal treatment of blood (1) comprising a filtration unit (2), a blood withdrawal line (6), a blood return line (7), an effluent fluid line (13), a pre and/or post-dilution fluid line (15, 25) connected to the blood withdrawal line, and a dialysis fluid line. Pumps (17, 18, 21, 22, 27) act on the fluid lines for regulating the flow of fluid. A control unit (10) is configured to periodically calculate a new value for the patient fluid removal rate to be imposed on an ultrafiltration actuator in order to keep a predefined patient fluid removal rate across a reference time interval irrespective of machine down times.