Denitrification is the process of reducing nitrates to gaseous nitrogen, which is then released into the atmosphere. This occurs in anaerobic conditions, such as in waterlogged soils, where there is a lack of oxygen to support the aerobic nitrifying bacteria. During denitrification, specialized bacteria convert nitrates (NO3-) into gaseous nitrogen (N2), nitrous oxide (N2O), and sometimes nitrogen dioxide (NO2), which are all released into the atmosphere. This process is an important part of the nitrogen cycle and helps to maintain the balance of nitrogen in the environment.