A method of operating a piston engine in a transient state using a gaseous main fuel that is introduced into the main combustion chamber of a cylinder of the engine during an intake stroke and a liquid pilot fuel that is introduced into the main combustion chamber or into a prechamber as one or more injection events taking place during a compression stroke for igniting the gaseous main fuel, the method comprising the steps of - monitoring a first measurement signal indicative of the engine output power or engine speed , - comparing the first measurement signal to a set point , - based on the comparison between the first measurement signal and the set point, generating a first control signal for controlling the amount of the gaseous main fuel , and - comparing the first control signal to a first limit value , wherein in case the first control signal is below the first limit value, - the amount of the gaseous main fuel introduced into the cylinders is controlled based on the first control signal , and in case the first control signal is above the first limit value, - a second control signal capped to the first limit value is generated and the amount of the gaseous main fuel introduced into the cylinders is controlled based on the second control signal , - the difference between the first control signal and the first limit value is determined , - the difference between the first control signal and the first limit value is used as an input for generating a third control signal , and - additional liquid fuel injection into the cylinders during a combustion stroke is controlled based on the third control signal . - monitoring a first measurement signal indicative of the engine output power or engine speed , - comparing the first measurement signal to a set point , - based on the comparison between the first measurement signal and the set point, generating a first control signal for controlling the amount of the gaseous main fuel , and - comparing the first control signal to a first limit value , in case the first control signal is below the first limit value, - the amount of the gaseous main fuel introduced into the cylinders is controlled based on the first control signal , and - the amount of the gaseous main fuel introduced into the cylinders is controlled based on the first control signal , and in case the first control signal is above the first limit value, - a second control signal capped to the first limit value is generated and the amount of the gaseous main fuel introduced into the cylinders is controlled based on the second control signal , - the difference between the first control signal and the first limit value is determined , - the difference between the first control signal and the first limit value is used as an input for generating a third control signal , and - additional liquid fuel injection into the cylinders during a combustion stroke is controlled based on the third control signal . - a second control signal capped to the first limit value is generated and the amount of the gaseous main fuel introduced into the cylinders is controlled based on the second control signal , - the difference between the first control signal and the first limit value is determined , - the difference between the first control signal and the first limit value is used as an input for generating a third control signal , and - additional liquid fuel injection into the cylinders during a combustion stroke is controlled based on the third control signal . <EOS>