A control device for an internal combustion engine having a variable valve timing mechanism which changes an opening or closing timing of one or both of an intake valve and an exhaust valve , comprising: detection means for detecting atmospheric pressure; first calculation means for calculating a charging efficiency based on an amount of air flowing through an intake air flow path; second calculation means for calculating a volumetric efficiency from the amount of air and the atmospheric pressure detected by the detection means; and setting means for setting the valve opening timing of the intake valve by the variable valve timing mechanism, wherein the setting means has a first calculation unit for calculating the valve opening timing of the intake valve based on the charging efficiency by the first calculation means, and a second calculation unit for calculating the valve opening timing of the intake valve based on the volumetric efficiency by the second calculation means, and sets the valve opening timing or valve opening timings of one or both of the intake valve and the exhaust valve based on one of the valve opening timing calculated by the first calculation unit and the valve opening timing calculated by the second calculation unit, wherein the setting means sets the charging efficiency valve opening timing by the first calculation unit or the volumetric efficiency valve opening timing by the second calculation unit, whichever is set to a more advanced angle side, as the valve opening timing of the intake valve, and wherein the internal combustion engine is equipped with supercharging means, and the second calculation unit calculates the latest timing of the valve opening timings, at which supercharging by the supercharging means can be achieved, as the valve opening timing of the intake valve, if a target torque calculated by a target torque calculation unit is within a range where the supercharging by the supercharging means is performed. detection means for detecting atmospheric pressure; first calculation means for calculating a charging efficiency based on an amount of air flowing through an intake air flow path; second calculation means for calculating a volumetric efficiency from the amount of air and the atmospheric pressure detected by the detection means; and setting means for setting the valve opening timing of the intake valve by the variable valve timing mechanism, wherein the setting means has a first calculation unit for calculating the valve opening timing of the intake valve based on the charging efficiency by the first calculation means, and a second calculation unit for calculating the valve opening timing of the intake valve based on the volumetric efficiency by the second calculation means, and sets the valve opening timing or valve opening timings of one or both of the intake valve and the exhaust valve based on one of the valve opening timing calculated by the first calculation unit and the valve opening timing calculated by the second calculation unit, wherein the setting means sets the charging efficiency valve opening timing by the first calculation unit or the volumetric efficiency valve opening timing by the second calculation unit, whichever is set to a more advanced angle side, as the valve opening timing of the intake valve, and wherein the internal combustion engine is equipped with supercharging means, and the second calculation unit calculates the latest timing of the valve opening timings, at which supercharging by the supercharging means can be achieved, as the valve opening timing of the intake valve, if a target torque calculated by a target torque calculation unit is within a range where the supercharging by the supercharging means is performed. <EOS>