A model-based approach to control BMEP (Brake Mean Effective Pressure) and NOx emissions has been developed and assessed on a FPT F1C 3.0L Euro VI diesel engine for heavy-duty applications. The controller is based on a zero-dimensional real-time combustion model, which is capable of simulating the HRR (heat release rate), in-cylinder pressure, BMEP and NOx engine-out levels. The real-time combustion model has been realized by integrating and improving previously developed simulation tools. A new discretization scheme has been developed for the model equations, in order to reduce the accuracy loss when the computational step is increased. This has allowed the required computational time to be reduced to a great extent. The real-time combustion model has been first calibrated and assessed at both steady-state and transient conditions, on the basis of experimental data acquired at the highly dynamic test bench of ICEAL-PT (Internal Combustion Engines Advanced Laboratory - Politecnico di Torino), in the frame of a research activity in collaboration with FPT Industrial. The model has then been used to realize a model-based control of BMEP and NOx emissions. In particular, the controller provides the injected fuel quantity and the injection timing of the main pulse, for given targets of BMEP and engine-out NOx levels. Finally, the developed controller has been tested on a rapid prototyping device (ETAS ES910) through HiL (Hardware-in-the-Loop) techniques, and demonstrated to have real-time capability.