In order to reduce NOx emissions in internal combustion engines, the present work analyzes a measurement which consists of injecting ammonia directly into the combustion chamber. A commercial compression ignition engine fueled with a hydrogen-diesel blend was studied numerically. It was verified that the flow rate shape in which the ammonia was injected, particularly rectangular, triangular, or parabolic, as well as the injection duration had an important influence on NOx reduction. A 11.4% improvement in NOx reduction, corresponding to an overall reduction of 78.2% in NOx, was found for parabolic injection shape and 1º injection duration. The effect on carbon dioxide, carbon monoxide, and hydrocarbon emissions, as well as brake-specific consumption, was negligible.