Transient emission peaks have become an important fraction of the total emissions during the standardized test cycles for passenger car Diesel engines. This paper is concerned with their reduction, in particular for nitric oxides (NOx) and particulate matter (PM) emissions, by online optimization. It is based on a former work  in which alternative target quantities for engine control were proposed, namely in-cylinder oxygen concentrations before (O2,BC) and after combustion (O2,AC). A generic nonlinear optimization is applied to provide a systematic determination for the optimal trajectories of these oxygen target quantities during a transient torque maneuver. The proposed method was implemented on a dynamic engine test bed using a production passenger car Diesel engine for the objective function evaluation. Torque response could be maintained unchanged while NOx as well as PM emission peaks were reduced significantly.