In an internal combustion engine, an NO X selective reduction catalyst (15) is arranged in an engine exhaust passage, an aqueous urea solution is fed to the NO X selective reduction catalyst (15) and the ammonia generated from the aqueous urea solution is made to be adsorbed at the NO X selective reduction catalyst (15), and the adsorbed ammonia is used to selectively reduce NO X . At the time the engine is stopped, when the ammonia adsorption amount at the NO X selective reduction catalyst (15) is smaller than a predetermined target amount of adsorption, the urea necessary for making the ammonia adsorption amount at the NO X selective reduction catalyst (15) the target amount of adsorption is fed to the NO X selective reduction catalyst (15) at the time the engine is stopped.