A control device for an internal combustion engine that comprises a selective catalytic reduction-type catalyst disposed in an exhaust passage, a NOx storage-reduction catalyst disposed upstream relative to the selective catalytic reduction-type catalyst in the exhaust passage, and an EGR apparatus that recirculates EGR gas from the exhaust passage to an intake passage, wherein: operation modes of the internal combustion engine that are selected by the control device include: a stoichiometric EGR mode that controls an in-cylinder air-fuel ratio to a theoretical air-fuel ratio, and a lean mode that controls the in-cylinder air-fuel ratio to an air-fuel ratio that is leaner than the theoretical air-fuel ratio; the control device comprising: first control means configured to, during a period in which the operation mode is switched from the stoichiometric EGR mode to the lean mode, execute a rich spike that supplies excessive fuel relative to the theoretical air-fuel ratio, and second control means configured to, when a temperature of the selective catalytic reduction-type catalyst at a time of switching from the stoichiometric EGR mode is greater than or equal to an upper limit temperature, after execution of the rich spike, switch to the lean mode after executing transient control that makes an EGR rate that is a proportion of EGR gas included in intake gas, higher than an EGR rate in the lean mode, and makes the in-cylinder air-fuel ratio leaner than the theoretical air-fuel ratio and richer than an air-fuel ratio in the lean mode. operation modes of the internal combustion engine that are selected by the control device include: a stoichiometric EGR mode that controls an in-cylinder air-fuel ratio to a theoretical air-fuel ratio, and a lean mode that controls the in-cylinder air-fuel ratio to an air-fuel ratio that is leaner than the theoretical air-fuel ratio; a stoichiometric EGR mode that controls an in-cylinder air-fuel ratio to a theoretical air-fuel ratio, and a lean mode that controls the in-cylinder air-fuel ratio to an air-fuel ratio that is leaner than the theoretical air-fuel ratio; the control device comprising: first control means configured to, during a period in which the operation mode is switched from the stoichiometric EGR mode to the lean mode, execute a rich spike that supplies excessive fuel relative to the theoretical air-fuel ratio, and second control means configured to, when a temperature of the selective catalytic reduction-type catalyst at a time of switching from the stoichiometric EGR mode is greater than or equal to an upper limit temperature, after execution of the rich spike, switch to the lean mode after executing transient control that makes an EGR rate that is a proportion of EGR gas included in intake gas, higher than an EGR rate in the lean mode, and makes the in-cylinder air-fuel ratio leaner than the theoretical air-fuel ratio and richer than an air-fuel ratio in the lean mode. first control means configured to, during a period in which the operation mode is switched from the stoichiometric EGR mode to the lean mode, execute a rich spike that supplies excessive fuel relative to the theoretical air-fuel ratio, and second control means configured to, when a temperature of the selective catalytic reduction-type catalyst at a time of switching from the stoichiometric EGR mode is greater than or equal to an upper limit temperature, after execution of the rich spike, switch to the lean mode after executing transient control that makes an EGR rate that is a proportion of EGR gas included in intake gas, higher than an EGR rate in the lean mode, and makes the in-cylinder air-fuel ratio leaner than the theoretical air-fuel ratio and richer than an air-fuel ratio in the lean mode.