The research presented here aims at providing a deeper understanding of the formation of nitric oxide in diesel combustion. To this end, in-cylinder distributions of nitric oxide (NO) were acquired by laser-induced fluorescence (LIF) in a rapid compression machine at conditions representative of a modern diesel passenger vehicle. In particular, the effects of injection and in-cylinder pressure on NO formation were investigated temporally and spatially to offer new insight into the formation of NO. Excitation and collection strategies were notably fine-tuned to avoid the collection of spurious signal due to oxygen (O2) fluorescence. NO fluorescence was first recorded slightly after the onset of the diffusion flame and until late in the expansion stroke. The early low levels of NO were located on the lean side of the high density of hydroxyl radicals (OH). The absence of NO inside the flame plume could however not be investigated because of the severe attenuation of the laser light attributed to hot CO2 molecules, intermediate species and soot. The formation rate of nitric oxide was found almost constant during the mixing-controlled combustion, the OH densities were restricted to the upstream part of the flame and moved inwards. High OH densities and high soot densities were not found to coexist. Finally, at the end of fuel injection, the spray collapsed on itself thus resulting in high densities of OH and NO throughout. Some of the NO seemed to be formed after the end of apparent combustion, when OH radicals were not detected. The observed fluorescence signal increase was linked to a rapid cooling of the flame plume and the associated freezing of the thermal NO mechanism. Injection pressure was found to influence the location and extent of regions with high densities of NO, but not the overall formation or width of the flame plume. Raising the in-cylinder pressure from 5 MPa to 7 MPa led to a shorter flame penetration and ignition delay with more NO formed early and in the upstream part of the flame. The plume and flame front width were seen to contract with rising in-cylinder pressure, and higher rates of NO formation could be observed as a result of increased air density and local temperatures.