The effects of fertilization and tractor traffic on N2O emission and CH4 uptake in agricultural soil were studied in a field trial with different fertilization and soil compaction. The soil was a well-drained sandy loam and the crop rotation was rich in ley and legumes. The fertilization treatments were: NPK fertilizer (140 kg NH4NO3-N ha-1); cattle slurry (CS) (189 kg total N ha-1), CS (81 kg total N ha-1), and an unfertilized treatment. The soil was experimentally compacted by two passes with a tractor, wheel by wheel, shortly before fertilization. Gas fluxes at the soil surface were measured by the soil cover method. Soil air at a depth of 7-12 cm was sampled through stationary soil air samplers. Concentrations of N2O in soil air were more than seven times higher in compacted, NPK-fertilized soil than in any other treatments. Maximum concentrations (1900 mul N2O l-1) were observed shortly after periods with heavy rain. The accumulated N2O emissions from the NPK-fertilized treatment (4 June-8 July) corresponded to 5.3% of added NH4NO3-N in compacted soil, and 3.9% in uncompacted soil. Fertilization with cattle slurry equivalent to 81 kg total N ha-1 gave an N2O emission corresponding to 3.1% of added NH4-N in uncompacted soil and 2.7% in compacted soil. Increasing levels of cattle slurry resulted in a reduction in N2O emission per kg NH4-N added. The accumulated CH4 uptake (4 June-8 July) in the soil was 9.7 mg CH4 M-2 in unfertilized and uncompacted soil. It was reduced by 52% by soil compaction, 50% on average by fertilization and 78% by soil compaction and fertilization combined. Fertilization with NH4NO3 or cattle slurry resulted in similar effects.