The availability of O2 is believed to be one of the main factors regulating nitrification and denitrification and the release of NO and N2O. The availability of O2 in soil is controlled by the O2 partial pressure in the gas phase and by the moisture content in the soil. Therefore, we investigated the influence of O2 partial pressures and soil moisture contents on the NO and N2O release in a sandy and a loamy silt and differentiated between nitrification and denitrification by selective inhibition of nitrification with 10 Pa acetylene. At 60% whc (maximum water holding capacity) NO and N2O release by denitrification increased with decreasing O2 partial pressure and reached a maximum under anoxic conditions. Under anoxic conditions NO and N2O were only released by denitrification. NO and N2O release by nitrification also increased with decreasing O2 partial pressure, but reached a maximum at 0.1–0.5% O2 and then decreased again. Nitrification was the main source of NO and N2O at O2 partial pressures higher than 0.1–0.5% O2. At lower O2 partial pressures denitrification was the main source of NO and N2O. With decreasing O2 partial pressure N2O release increased more than NO release, indicating that the N2O release was more sensitive against O2 than the NO release. At ambient O2 partial pressure (20.5% O2) NO and N2O release by denitrification increased with increasing soil moisture content. The maximum NO and N2O release was observed at soil moisture contents of 65–80% whc and 100% whc, respectively. NO and N2O release by nitrification also increased with increasing soil moisture content with a maximum at 45–55% whc and 90% whc, respectively. Nitrification was the main source of NO and N2O at soil moisture contents lower than 90% whc and 80% whc, respectively. Higher soil moisture contents favoured NO and N2O release by denitrification. Soil texture had also an effect on the release of NO and N2O. The coarse-textured sandy silt released more NO than N2O compared with the fine-textured loamy silt. At high soil moisture contents (80–100% whc) the fine-textured soil showed a higher N2O release by denitrification than the coarse-textured soil. We assume that the fine-textured soil became anoxic at a lower soil moisture content than the coarse-textured soil. In conclusion, the effects of O2 partial pressure, soil moisture and soil texture were consistent with the theory that denitrification increasingly contributes to the release of NO and in particular N2O when conditions for soil microorganisms become increasingly anoxic.