A method for controlling an apparatus for treating blood outside the human body, with a view to improving the operation of the apparatus, the apparatus including a semi-permeable membrane carrying out an exchange of solutes, referred to as dialysis, and of liquid, referred to as ultrafiltration, with the blood, the method including at least one iteration of the following steps: determination of a so-called instantaneous value, of an ultrafiltration coefficient corresponding to the ratio of an ultrafiltration flow rate to a difference in pressure, the so-called transmembrane pressure, on either side of the semi-permeable membrane, comparison of the instantaneous value with at least one previously determined characteristic value; and control of the treatment apparatus to reach a maximum value of the ultrafiltration coefficient, the control including a variation of the ultrafiltration flow rate up to a value corresponding to the maximum value of the ultrafiltration coefficient.