Blending with a high-reactivity fuel is recognized as an effective way to overcome poor combustion and heavy emissions of ammonia (NH 3 ). In this study, we investigated the combustion performance and nitrogen-based emissions of an nheptane/ammonia blend in an optical engine operating under reactivity-controlled compression ignition (RCCI) mode, addressing the n-heptane energy ratio and injection timing. Considering the long ignition delay time of pure ammonia, the n-heptane energy ratio was selected as 20−40%, and the injection timings were selected as −70 to −35 °CA aTDC. The results demonstrate the substantial impact of both variables on engine performance. Notably, a critical injection timing (SOI = −50 °CA aTDC) was identified, exhibiting optimal combustion stabilities, while an increased n-heptane energy ratio facilitated the expansion of the stable operating conditions and increased the indicated mean effective pressure by up to 6.4%. Combustion visualization showed a transition in combustion mode from flame propagation to sequential autoignition with the advancement of injection timing, resulting in a more homogeneous combustion. Meanwhile, optimal flame development was observed at the critical injection timing. As the heptane fraction decreased, autoignition timing was obviously retarded and flame development depended on the local temperature field, suggesting the potential for the modulation of combustion mode through controlling the injection timing and energy ratio. Regarding nitrogen-based emissions, an advanced injection timing correlated with more homogeneous combustion, leading to a decrease of NH 3 by up to 47.7% and an increase of NO and NO 2 by approximately up to 65.9 and 22.4%, respectively. As the n-heptane energy ratio decreased, unburned NH 3 emissions increased by up to 40.4%, while NO 2 emissions decreased by up to 11.2%. NO emissions exhibited an initial increase followed by a subsequent decrease, and the maximum value reached 2698 ppm at the n-heptane energy ratio of 30%. N 2 O emissions displayed negative correlations with the autoignition timing and flame propagation speed, consistent with the observed variations in combustion stabilities.