Mycobacterium tuberculosis, the causative agent of human tuberculosis, encodes a haemoprotein named Truncated Haemoglobin N (trHbN), which in its active site transforms nitric oxide (NO) to nitrate anion. ]> . The NO-dioxygenase activity of trHbN seems to be crucial for the bacillus, which can survive under the nitrosative stress conditions that occur upon infection of the host. As a defense mechanism against the copious amounts of NO produced by macrophages upon infection, the protein must achieve a high level of NO-dioxygenase activity to eliminate NO, but this is modulated by its efficiency in capturing O2 and NO. Migration of small diatomic ligands through the protein matrix is related to the presence of a doubly branched tunnel system connecting the surface and the haem cavity site. In this work, we have studied the mechanism that controls ligand diffusion and product egression with state-of-the-art molecular dynamics simulations. The results support a dual path mechanism for migration of O2 and NO through distinct branches of the tunnel, where migration of NO is facilitated upon binding of O2 to the haem group. Finally, egression of ]> is preceded by the entrance of water to the haem cavity and occurs through a different pathway. Overall, the results highlight the intimate relationship between structure, dynamical behavior and biological function of trHbN. [ABSTRACT FROM AUTHOR]