A controller for an internal combustion engine, the controller comprising: a direct injection valve, which is configured to directly inject fuel into a cylinder; a NOx storage reduction type catalyst provided in an exhaust passage; an addition valve provided in the exhaust passage on an upstream side of the catalyst to add engine fuel to the exhaust gas; a poison release control section, which is configured to execute a poison release control for reducing sulfur compound deposited on the catalyst by alternately repeating a desorption process of desorbing the sulfur compound deposited on the catalyst by performing a fuel supply from the direct injection valve to the exhaust gas in a state in which a temperature of the catalyst is increased to a desorbable temperature, at which the sulfur compound deposited on the catalyst is desorbed, and a pausing process of pausing the supply of fuel from the direct injection valve to the exhaust gas; and a cooling fuel addition section which is configured to execute a cooling fuel addition control of performing a cooling fuel addition for cooling the addition valve by adding engine fuel from the addition valve during execution of the pausing process, and prohibiting the cooling fuel addition during execution of the desorption process, wherein the cooling fuel addition section includes a target temperature calculation section, which is configured to calculate a target temperature (Td) of the addition valve at the time of start of the desorption process such that the temperature of the addition valve during execution of the desorption process does not exceed a predetermined allowable upper limit temperature (Tc), and an addition amount calculation section, wherein, when an amount of fuel added from the addition valve at the time of execution of the cooling fuel addition during execution of the pausing process is defined as a cooling fuel addition amount, the addition amount calculation section calculates the cooling fuel addition amount such that the temperature of the addition valve at the time of start of the desorption process becomes the target temperature (Td). a direct injection valve, which is configured to directly inject fuel into a cylinder; a NOx storage reduction type catalyst provided in an exhaust passage; an addition valve provided in the exhaust passage on an upstream side of the catalyst to add engine fuel to the exhaust gas; a poison release control section, which is configured to execute a poison release control for reducing sulfur compound deposited on the catalyst by alternately repeating a desorption process of desorbing the sulfur compound deposited on the catalyst by performing a fuel supply from the direct injection valve to the exhaust gas in a state in which a temperature of the catalyst is increased to a desorbable temperature, at which the sulfur compound deposited on the catalyst is desorbed, and a pausing process of pausing the supply of fuel from the direct injection valve to the exhaust gas; and a desorption process of desorbing the sulfur compound deposited on the catalyst by performing a fuel supply from the direct injection valve to the exhaust gas in a state in which a temperature of the catalyst is increased to a desorbable temperature, at which the sulfur compound deposited on the catalyst is desorbed, and a pausing process of pausing the supply of fuel from the direct injection valve to the exhaust gas; and a cooling fuel addition section which is configured to execute a cooling fuel addition control of performing a cooling fuel addition for cooling the addition valve by adding engine fuel from the addition valve during execution of the pausing process, and prohibiting the cooling fuel addition during execution of the desorption process, wherein the cooling fuel addition section includes a target temperature calculation section, which is configured to calculate a target temperature (Td) of the addition valve at the time of start of the desorption process such that the temperature of the addition valve during execution of the desorption process does not exceed a predetermined allowable upper limit temperature (Tc), and an addition amount calculation section, wherein, when an amount of fuel added from the addition valve at the time of execution of the cooling fuel addition during execution of the pausing process is defined as a cooling fuel addition amount, the addition amount calculation section calculates the cooling fuel addition amount such that the temperature of the addition valve at the time of start of the desorption process becomes the target temperature (Td). a target temperature calculation section, which is configured to calculate a target temperature (Td) of the addition valve at the time of start of the desorption process such that the temperature of the addition valve during execution of the desorption process does not exceed a predetermined allowable upper limit temperature (Tc), and an addition amount calculation section, wherein, when an amount of fuel added from the addition valve at the time of execution of the cooling fuel addition during execution of the pausing process is defined as a cooling fuel addition amount, the addition amount calculation section calculates the cooling fuel addition amount such that the temperature of the addition valve at the time of start of the desorption process becomes the target temperature (Td).