In this work, a model framework was constructed to assess and predict nitrous oxide (N2O) production, substrate and microbe interactions in an anammox biofilm bioreactor. The anammox kinetics were extended by including kinetics of autotrophic soluble microbial products (SMP) formation, which consisted of utilization-associated products (UAP) and biomass-associated products (BAP). Heterotrophic bacteria growing on UAP, BAP and decay released substance (SS) were modelled to perform four-step sequential reductions from nitrate to dinitrogen gas. N2O was modelled as an intermidiate of heterotrophic denitrification via three pathways with UAP, BAP and SS as the electron donors. The developed model framework was evaluated using long-term operational data from an anammox biofilm reactor and satisfactorily reproduced effluent nitrogen and SMP as well as N2O emission factors under different operational conditions. The modeling results revealed that N2O was mainly produced with UAP as the electron donor while BAP and SS play minor roles. Heterotrophic denitrifiers growing on UAP would significantly contribute to N2O emission from anammox biofilm reactor even though heterotrophs only account for a relatively small fraction of active biomass in the anammox biofilm. Comprehensive simulations were conducted to investigate the effects of N loading rate and biofilm thickness, which indicated that maintaining a low N loading rate and a thick biofilm thickness were essential for high total nitrogen removal efficiency and low N2O emission.