Manufacturers of diesel engines are under increasing pressure to meet progressively stricter NO x emission limits. A key NO x abatement technology is selective catalytic reduction in which ammonia, aided by a catalyst, reacts with NO x in the exhaust stream to produce nitrogen and water. The conversion efficiency is temperature dependent: at low temperature, reaction rates are temperature limited, resulting in suboptimal NO x removal, whereas at high temperatures, they are mass transfer limited. Maintaining sufficiently high temperature to allow maximal conversion is a challenge, particularly after cold start, as well as during conditions in which exhaust heat is insufficient, such as periods of low load or idling. In this work, a nonlinear model predictive controller simultaneously manages urea injection and power to an electric catalyst heater, in the presence of constraints.