The rotational acceleration of an engine is calculated based on a
detection value of an engine rotating speed, the inertia torque to be
transmitted to a variable valve mechanism, such as a variable valve
timing control mechanism or the like, is calculated based on the
rotational acceleration, a correction amount of a manipulated variable
for the variable valve mechanism, which is in compliance with the inertia
torque, is calculated, and the manipulated variable for the variable
valve mechanism is corrected with the correction amount according to the
inertia torque, to thereby control the variable valve mechanism based on
the corrected manipulated variable.