Agricultural soils in semiarid Mediterranean areas are characterized by low organic matter contents and low fertility levels. Application of crop residues and/or manures as amendments is a cost-effective and sustainable alternative to overcome this problem. However, these management practices may induce important changes in the nitrogen oxide emissions from these agroecosystems, with additional impacts on carbon dioxide emissions. In this context, a field experiment was carried out with a barley (Hordeum vulgare L.) crop under Mediterranean conditions to evaluate the effect of combining maize (Zea mays L.) residues and N fertilizer inputs (organic and/or mineral) on these emissions. Crop yield and N uptake, soil mineral N concentrations, dissolved organic carbon (DOC), denitrification capacity, N2O, NO and CO2 fluxes were measured during the growing season. The incorporation of maize stover increased N2O emissions during the experimental period by c. 105 %. Conversely, NO emissions were significantly reduced in the plots amended with crop residues. The partial substitution of urea by pig slurry reduced net N2O emissions by 46 and 39 %, with and without the incorporation of crop residues respectively. Net emissions of NO were reduced 38 and 17 % for the same treatments. Molar DOC:NO (3) (-) ratio was found to be a robust predictor of N2O and NO fluxes. The main effect of the interaction between crop residue and N fertilizer application occurred in the medium term (4-6 month after application), enhancing N2O emissions and decreasing NO emissions as consequence of residue incorporation. The substitution of urea by pig slurry can be considered a good management strategy since N2O and NO emissions were reduced by the use of the organic residue.