An engine having a fuel injector for normally feeding a lean air-fuel mixture into the engine cylinders. Ignition timing is determined so that it is suitable for the lean air-fuel mixture. The gear changing operation of the transmission of the engine is detected from the change in the engine speed and the change in the absolute pressure in the intake passage. When the gear changing operation is carried out, a rich air-fuel mixture is fed into the engine cylinders, and the ignition timing is retarded.