A method of controlling a high pressure gas injection internal combustion engine includes injecting, in a first combustion mode, by a first as injection system, a first gaseous fuel into a cylinder of the engine, and accumulating in a container of a second gas injection system excess gaseous fuel from the first fuel system, shifting, in the cylinder, from the first combustion mode to a second combustion mode including determining a value of an air flow related parameter indicative of an air mass flow into the cylinder, determining, based on the determined air flow related parameter value, a value of a fuel flow related parameter indicative of a mass flow of the excess gaseous fuel, and supplying from the container, in accordance with the determined fuel flow related parameter value, the excess gaseous fuel to provide a premix of air and the excess gaseous fuel to the cylinder.