A control apparatus of an internal combustion engine, the internal combustion engine including a first variable valve mechanism configured to change a valve-open period (INCAM) of an intake valve by advancing or retarding a valve-opening timing and a valve-closing timing of the intake valve, and a second variable valve mechanism configured to change a valve-open period (EXCAM) of an exhaust valve by advancing or retarding a valve-opening timing and a valve-closing timing of the exhaust valve, the control apparatus comprising: a control portion configured to control driving of the first variable valve mechanism and the second variable valve mechanism, the control portion being configured to: execute a process to increase the valve-open period (INCAM) of the intake valve by advancing the valve-opening timing of the intake valve and retarding the valve-closing timing of the intake valve to reduce the compression ratio in order to decrease the temperature of the intake air compressed inside the cylinder to inhibit occurrence of abnormal compression and to reduce the valve-open period (EXCAM) of the exhaust valve by advancing the valve-closing timing of the exhaust valve and retarding the valve-opening timing of the exhaust valve in order to inhibit a decrease of the energy efficiency of the internal combustion engine, so that an increase in the valve overlap amount when increasing the valve-open period (INCAM) of the intake valve is inhibited the control portion being configured to execute the process when idling at which a temperature of the internal combustion engine is equal to or higher than a reference value before fuel injection is stopped by an engine stop request. a first variable valve mechanism configured to change a valve-open period (INCAM) of an intake valve by advancing or retarding a valve-opening timing and a valve-closing timing of the intake valve, and a second variable valve mechanism configured to change a valve-open period (EXCAM) of an exhaust valve by advancing or retarding a valve-opening timing and a valve-closing timing of the exhaust valve, a control portion configured to control driving of the first variable valve mechanism and the second variable valve mechanism, the control portion being configured to: execute a process to increase the valve-open period (INCAM) of the intake valve by advancing the valve-opening timing of the intake valve and retarding the valve-closing timing of the intake valve to reduce the compression ratio in order to decrease the temperature of the intake air compressed inside the cylinder to inhibit occurrence of abnormal compression and to reduce the valve-open period (EXCAM) of the exhaust valve by advancing the valve-closing timing of the exhaust valve and retarding the valve-opening timing of the exhaust valve in order to inhibit a decrease of the energy efficiency of the internal combustion engine, so that an increase in the valve overlap amount when increasing the valve-open period (INCAM) of the intake valve is inhibited execute a process to increase the valve-open period (INCAM) of the intake valve by advancing the valve-opening timing of the intake valve and retarding the valve-closing timing of the intake valve to reduce the compression ratio in order to decrease the temperature of the intake air compressed inside the cylinder to inhibit occurrence of abnormal compression and to reduce the valve-open period (EXCAM) of the exhaust valve by advancing the valve-closing timing of the exhaust valve and retarding the valve-opening timing of the exhaust valve in order to inhibit a decrease of the energy efficiency of the internal combustion engine, to increase the valve-open period (INCAM) of the intake valve by advancing the valve-opening timing of the intake valve and retarding the valve-closing timing of the intake valve to reduce the compression ratio in order to decrease the temperature of the intake air compressed inside the cylinder to inhibit occurrence of abnormal compression and to reduce the valve-open period (EXCAM) of the exhaust valve by advancing the valve-closing timing of the exhaust valve and retarding the valve-opening timing of the exhaust valve in order to inhibit a decrease of the energy efficiency of the internal combustion engine, so that an increase in the valve overlap amount when increasing the valve-open period (INCAM) of the intake valve is inhibited the control portion being configured to execute the process when idling at which a temperature of the internal combustion engine is equal to or higher than a reference value before fuel injection is stopped by an engine stop request.