Passivation of semiconductor surfaces is conveniently realized by terminating surface dangling bonds with a monovalent atom such as hydrogen using a simple wet chemical process (for example, HF treatment for silicon). However, the real potential of surface chemical passivation lies in the ability to replace surface hydrogen by multivalent atoms to form surfaces with tailored properties. Although some progress has been made to attach organic layers on top of H-terminated surfaces, it has been more challenging to understand and control the incorporation of multivalent atoms, such as oxygen and nitrogen, within the top surface layer of H-terminated surfaces. The difficulty arises partly because such processes are dominated by defect sites. Here, we report mechanistic pathways involved in the nitridation of H-terminated silicon surfaces using ammonia vapour. Surface infrared spectroscopy and first-principles calculations clearly show that the initial interaction is dominated by the details of the surface morphology (defect structure) and that NH and NH(2) are precursors to N insertion into Si-Si bonds. For the dihydride-stepped Si(111) surface, a unique reaction pathway is identified leading to selective silazane step-edge formation at the lowest reaction temperatures.