A control device for an engine in which partial compression-ignition combustion is executed at least within a part of an operating range of the engine, the partial compression-ignition combustion including spark ignition combustion and compression ignition combustion, the spark ignition being to be performed by combusting a portion of a mixture gas inside a cylinder by spark-ignition and followed by the compression ignition combustion, the compression ignition being to be performed by causing the remaining mixture gas inside the cylinder to self-ignite, the control device comprising: a manipulator (13a, 14a, 32, 53) configured to change an air-fuel ratio of air to fuel introduced into the cylinder; a controller configured to determine combustion stability and control the manipulator (13a, 14a, 32, 53) to reduce the air-fuel ratio, during the partial compression-ignition combustion, based on the combustion stability; and a detector configured to detect at least one parameter that changes as combustion progresses inside the cylinder, characterized in that the controller is configured to identify, based on the detected parameter of the detector, a first mass combustion timing at which substantially a 10% of a total mass of fuel injected into a combustion chamber in one combustion cycle combusts and a second mass combustion timing at which substantially a half of the total mass of fuel injected into the combustion chamber in one combustion cycle combusts, and determine the combustion stability based on a variation in combustion speed between cycles calculated based on the first and second mass combustion timings (MFB10, MFB50), the controller is configured to select one of a first mode and a second mode, as a combustion mode of the partial compression-ignition combustion, in the first mode the partial compression-ignition combustion is performed in an environment in which the air-fuel ratio is higher than a stoichiometric air-fuel ratio, in the second mode the partial compression-ignition combustion is performed in an environment in which a gas-fuel ratio is higher than the stoichiometric air-fuel ratio, the air-fuel ratio is substantially the stoichiometric air-fuel ratio, and at least a portion of the fuel is injected during an intake stroke, the gas-fuel ratio is a ratio of a total gas including exhaust gas recirculation gas to fuel inside the cylinder, and the controller is configured to switch the combustion mode from the first mode to the second mode, when it is confirmed, during the partial compression-ignition combustion in the first mode, that a standard deviation of the combustion speed is larger than a given threshold. a manipulator (13a, 14a, 32, 53) configured to change an air-fuel ratio of air to fuel introduced into the cylinder; a controller configured to determine combustion stability and control the manipulator (13a, 14a, 32, 53) to reduce the air-fuel ratio, during the partial compression-ignition combustion, based on the combustion stability; and a detector configured to detect at least one parameter that changes as combustion progresses inside the cylinder, characterized in that the controller is configured to identify, based on the detected parameter of the detector, a first mass combustion timing at which substantially a 10% of a total mass of fuel injected into a combustion chamber in one combustion cycle combusts and a second mass combustion timing at which substantially a half of the total mass of fuel injected into the combustion chamber in one combustion cycle combusts, and determine the combustion stability based on a variation in combustion speed between cycles calculated based on the first and second mass combustion timings (MFB10, MFB50), the controller is configured to select one of a first mode and a second mode, as a combustion mode of the partial compression-ignition combustion, in the first mode the partial compression-ignition combustion is performed in an environment in which the air-fuel ratio is higher than a stoichiometric air-fuel ratio, in the second mode the partial compression-ignition combustion is performed in an environment in which a gas-fuel ratio is higher than the stoichiometric air-fuel ratio, the air-fuel ratio is substantially the stoichiometric air-fuel ratio, and at least a portion of the fuel is injected during an intake stroke, the gas-fuel ratio is a ratio of a total gas including exhaust gas recirculation gas to fuel inside the cylinder, and the controller is configured to switch the combustion mode from the first mode to the second mode, when it is confirmed, during the partial compression-ignition combustion in the first mode, that a standard deviation of the combustion speed is larger than a given threshold.