A method for controlling a compressor towards an unloaded state, in which the compressor comprises a compressor element, the compressor element being equipped with: - an inlet and a controllable inlet valve with a valve inlet, in which the inlet valve is configured to be able to at least partially close the inlet of the compressor element; and - an outlet with thereto connected a pressure line which is connected with a downstream consumer network, in which the compressor further comprises a controllable blow-off valve that is connected to the pressure line, in which in a loaded state of the compressor, the blow-off valve is closed and the inlet valve is entirely open, and in which for a transition from the loaded state towards the unloaded state, the method provides for the following steps: - determining an operating pressure (pis) in the consumer network; - when this operating pressure (pis) reaches a set maximum operating pressure (p 15max), the opening of the blow-off valve and the partial closing by the inlet valve of the inlet of the compressor element, such that after a transition period from the loaded state of the compressor to the unloaded state, in the unloaded state, a residual flow (Q D) is suctioned via the inlet towards and into the compressor element, characterized in that the partial closing of the inlet during the transition period is performed in successive discrete transitional steps; and the residual flow (Q D) corresponds with a minimum gas flow required to maintain a minimum equilibrium pressure (p 12u) in a pressure tank connected to the pressure line. - an inlet and a controllable inlet valve with a valve inlet, in which the inlet valve is configured to be able to at least partially close the inlet of the compressor element; and - an outlet with thereto connected a pressure line which is connected with a downstream consumer network, in which the compressor further comprises a controllable blow-off valve that is connected to the pressure line, in which in a loaded state of the compressor, the blow-off valve is closed and the inlet valve is entirely open, and in which for a transition from the loaded state towards the unloaded state, the method provides for the following steps: - determining an operating pressure (pis) in the consumer network; - when this operating pressure (pis) reaches a set maximum operating pressure (p 15max), the opening of the blow-off valve and the partial closing by the inlet valve of the inlet of the compressor element, such that after a transition period from the loaded state of the compressor to the unloaded state, in the unloaded state, a residual flow (Q D) is suctioned via the inlet towards and into the compressor element, characterized in that the partial closing of the inlet during the transition period is performed in successive discrete transitional steps; and the residual flow (Q D) corresponds with a minimum gas flow required to maintain a minimum equilibrium pressure (p 12u) in a pressure tank connected to the pressure line. in which the compressor further comprises a controllable blow-off valve that is connected to the pressure line, in which in a loaded state of the compressor, the blow-off valve is closed and the inlet valve is entirely open, and in which for a transition from the loaded state towards the unloaded state, the method provides for the following steps: - determining an operating pressure (pis) in the consumer network; - when this operating pressure (pis) reaches a set maximum operating pressure (p 15max), the opening of the blow-off valve and the partial closing by the inlet valve of the inlet of the compressor element, such that after a transition period from the loaded state of the compressor to the unloaded state, in the unloaded state, a residual flow (Q D) is suctioned via the inlet towards and into the compressor element, - determining an operating pressure (pis) in the consumer network; - when this operating pressure (pis) reaches a set maximum operating pressure (p 15max), the opening of the blow-off valve and the partial closing by the inlet valve of the inlet of the compressor element, such that after a transition period from the loaded state of the compressor to the unloaded state, in the unloaded state, a residual flow (Q D) is suctioned via the inlet towards and into the compressor element, characterized in that the partial closing of the inlet during the transition period is performed in successive discrete transitional steps; and the residual flow (Q D) corresponds with a minimum gas flow required to maintain a minimum equilibrium pressure (p 12u) in a pressure tank connected to the pressure line.