The invention relates to a method of controlling a respiratory assistance apparatus delivering a flow of gas, particularly a flow of air, comprising the steps of measuring at least one parameter indicative of said flow of gas; converting said at least one parameter indicative of said flow of gas into at least one signal indicative of said flow of gas; processing said at least one signal indicative of the flow of gas in order therefrom to deduce at least one item of information relating to cardiac massage being performed on a patient in cardiac arrest; on the basis of said at least one deduced item of information, automatically selecting a given ventilation mode from among a number of stored ventilation modes, and controlling the respiratory assistance apparatus by applying the selected ventilation mode. Respiratory assistance apparatus capable of implementing said control method.