PURPOSE: To always control the accurate injection amount by calculating the first fuel injection amount by the timing wherein an intake valve is closed on the basis of the engine operating state, and calculating the second fuel injection amount by the timing just before the intake valve is released on the basis of the operating state.
CONSTITUTION: The first injection amount is calculated before the top dead center where an intake valve 5a is closed on the basis of the cooling water temperature, and fuel is injected on the basis of it. The injection finishing time is set on the basis of the first fuel injection amount, and fuel injection is carried out to the injection finishing time. In the timing just before the intake valve 5a is opened, when the fuel injection is carried out, the second fuel injection amount is calculated on the basis of the cooling water temperature, and fuel injection is adjusted on the basis of this second fuel injection amount. When the injection time is longer than that of the second injection amount, the fuel injection is finished. Thereby, the fuel injection can be accurately corrected even if the operating state is suddenly changed.