A control device for an internal combustion engine, the internal combustion engine comprising: an engine body; and a fuel injector injecting fuel for making it burn inside a combustion chamber of the engine body, wherein the control device comprises a combustion control part configured to cause heat to be generated in the combustion chamber two times in stages to give a pressure waveform showing a change over time of a rate of cylinder pressure rise which has two peaks by successively performing at least a first main fuel injection so as to cause premix charged compressive ignition of fuel, and a second main fuel injection, characterized in that the second main fuel injection is performed so as to cause premix charged compressive ignition of fuel; the combustion control part comprises a second premix time calculating part calculating a second premix time which is an estimated value of a premix time of fuel, injected by the second main fuel injection, with air, wherein the second premix time is the time from the time of end of the second main fuel injection to when fuel injected by the second main fuel injection is ignited; and the combustion control part is configured to: reduce the fuel injection amount of the second main injection so that the second premix time becomes a predetermined first threshold value or more and perform an after fuel injection after the second main fuel injection when the second premix time is less than the first threshold value; and inject the amount of fuel reduced from the injection amount of the second main fuel injection by the after fuel injection. the internal combustion engine comprising: an engine body; and a fuel injector injecting fuel for making it burn inside a combustion chamber of the engine body, wherein an engine body; and a fuel injector injecting fuel for making it burn inside a combustion chamber of the engine body, wherein the control device comprises a combustion control part configured to cause heat to be generated in the combustion chamber two times in stages to give a pressure waveform showing a change over time of a rate of cylinder pressure rise which has two peaks by successively performing at least a first main fuel injection so as to cause premix charged compressive ignition of fuel, and a second main fuel injection, characterized in that the second main fuel injection is performed so as to cause premix charged compressive ignition of fuel; the combustion control part comprises a second premix time calculating part calculating a second premix time which is an estimated value of a premix time of fuel, injected by the second main fuel injection, with air, wherein the second premix time is the time from the time of end of the second main fuel injection to when fuel injected by the second main fuel injection is ignited; and the combustion control part is configured to: reduce the fuel injection amount of the second main injection so that the second premix time becomes a predetermined first threshold value or more and perform an after fuel injection after the second main fuel injection when the second premix time is less than the first threshold value; and inject the amount of fuel reduced from the injection amount of the second main fuel injection by the after fuel injection. reduce the fuel injection amount of the second main injection so that the second premix time becomes a predetermined first threshold value or more and perform an after fuel injection after the second main fuel injection when the second premix time is less than the first threshold value; and inject the amount of fuel reduced from the injection amount of the second main fuel injection by the after fuel injection.