Soil microbial denitrification is a significant source of atmospheric nitrous oxide (N2O), a trace gas important in global climate change and stratospheric ozone depletion. In this paper we describe a mechanistic submodel, which is incorporated in the model NLOSS, designed to predict the soil biogenic source and efflux of N2O and N2 during denitrification. NLOSS simulates transient soil moisture and temperature, decomposition, soil anaerobicity, denitrifying bacterial biomass, rates of soil nitrogen transformations, soil trace-gas transport, and gas efflux to the atmosphere. Uncertainty in predicted N gas effluxes is computed using a Monte Carlo approach. We test NLOSS's denitrification estimates by comparing predictions with results from a 15N tracer experiment in a Mexican agricultural system. The model accurately predicted the measured soil moisture and denitrified N2O and N2 fluxes during the experiment. We also apply NLOSS to compute denitrified N trace-gas speciation curves as a function of soil hydrologic properties and moisture content. These speciation curves will be used in future work to extrapolate the plot-scale modeling results presented here to field and regional estimates of N trace-gas emissions. The results presented here suggest that NLOSS can be used to identify the processes most important for trace-gas losses and to facilitate efforts to scale plot-level modeling results to regional estimates of N trace-gas emissions.