A mathematical model of oxygen uptake by bacteria in agricultural soils is presented with the goal of predicting anaerobic regions in which denitrification occurs. In an environment with a plentiful supply of oxygen, micro-organisms consume oxygen through normal respiration. When the local oxygen concentration falls below a threshold level, denitrification may take place leading to the release of nitrous oxide, a potent agent for global warming. A two-dimensional model is presented in which one or more circular soil aggregates are located at a distance below the ground level at which the prevailing oxygen concentration is prescribed. The level of denitrification is estimated by computing the area of any anaerobic cores, which may develop in the interior of the aggregates. The oxygen distribution throughout the model soil is calculated first for an aggregated soil for which the ratio of the oxygen diffusivities between an aggregate and its surround is small via an asymptotic analysis. Second, the case of a non-aggregated soil featuring one or more microbial hotspots, for which the diffusion ratio is arbitrary, is examined numerically using the boundary-element method.Calculations with multiple aggregates demonstrate a sheltering effect whereby some aggregates receive less oxygen than their neighbours. In the case of an infinite regular triangular network representing an aggregated soil, it is shown that there is an optimal inter-aggregate spacing which minimises the total anaerobic core area.