An engine system including an engine having a cylinder and a piston reciprocatably accommodated in the cylinder, comprising: an injector attached to the engine and configured to inject fuel into the cylinder; a spark plug (251, 252) attached to the engine and configured to ignite a mixture gas of fuel and intake air, the intake air containing fresh air and burnt gas; a variable valve operating device (231, 232, 241, 242) connected to an intake valve and an exhaust valve, and configured to control opening and closing of the intake valve and the exhaust valve to adjust a filling amount of the intake air; and a controller electrically connected to the injector, the spark plug (251, 252), and the variable valve operating device (231, 232, 241, 242), and configured to control the injector, the spark plug (251, 252), and the variable valve operating device (231, 232, 241, 242) according to a demanded load of the engine, wherein when the engine operates at a given speed and the demanded load is a first load or a second load higher than the first load, the controller is configured to control the injector and the spark plug (251, 252) so that the mixture gas inside the cylinder combusts by compression ignition, wherein the controller is configured to estimate an intake-valve-closing temperature that is the temperature inside the cylinder at a close timing of the intake valve, wherein while the engine operates at the given speed and the demanded load is the first load, when the intake-valve-closing temperature is above a first temperature, the controller is configured to control the injector and the spark plug (251, 252) so that an entire mixture gas inside the cylinder combusts by compression ignition, and when the intake-valve-closing temperature is below the first temperature, the controller is configured to control the injector and the spark plug (251, 252) so that at least part of the mixture gas inside the cylinder combusts by flame propagation, and wherein while the engine operates at the given speed and the demanded load is the second load, when the intake-valve-closing temperature is above a second temperature lower than the first temperature, the controller is configured to control the injector and the spark plug (251, 252) so that the entire mixture gas inside the cylinder combusts by compression ignition, and when the intake-valve-closing temperature is below the second temperature, the controller is configured to control the injector and the spark plug (251, 252) so that at least part of the mixture gas inside the cylinder combusts by flame propagation. an injector attached to the engine and configured to inject fuel into the cylinder; a spark plug (251, 252) attached to the engine and configured to ignite a mixture gas of fuel and intake air, the intake air containing fresh air and burnt gas; a variable valve operating device (231, 232, 241, 242) connected to an intake valve and an exhaust valve, and configured to control opening and closing of the intake valve and the exhaust valve to adjust a filling amount of the intake air; and a controller electrically connected to the injector, the spark plug (251, 252), and the variable valve operating device (231, 232, 241, 242), and configured to control the injector, the spark plug (251, 252), and the variable valve operating device (231, 232, 241, 242) according to a demanded load of the engine, wherein when the engine operates at a given speed and the demanded load is a first load or a second load higher than the first load, the controller is configured to control the injector and the spark plug (251, 252) so that the mixture gas inside the cylinder combusts by compression ignition, wherein the controller is configured to estimate an intake-valve-closing temperature that is the temperature inside the cylinder at a close timing of the intake valve, wherein while the engine operates at the given speed and the demanded load is the first load, when the intake-valve-closing temperature is above a first temperature, the controller is configured to control the injector and the spark plug (251, 252) so that an entire mixture gas inside the cylinder combusts by compression ignition, and when the intake-valve-closing temperature is below the first temperature, the controller is configured to control the injector and the spark plug (251, 252) so that at least part of the mixture gas inside the cylinder combusts by flame propagation, and wherein while the engine operates at the given speed and the demanded load is the second load, when the intake-valve-closing temperature is above a second temperature lower than the first temperature, the controller is configured to control the injector and the spark plug (251, 252) so that the entire mixture gas inside the cylinder combusts by compression ignition, and when the intake-valve-closing temperature is below the second temperature, the controller is configured to control the injector and the spark plug (251, 252) so that at least part of the mixture gas inside the cylinder combusts by flame propagation.