Agriculture is an important source of ammonia (NH3), which contributes to acidification and eutrophication, as well as emissions of the greenhouse gases nitrous oxide (N2O) and methane (CH4). Controlling emissions of one of these pollutants through application of technical measures might have an impact (either beneficial or adverse) on emissions of the others. These side effects are usually ignored in policy making. This study analyses cost-effectiveness of measures to reduce acidification and eutrophication as well as agricultural emissions of N2O and CH4 in Europe, taking into account interrelations between abatement of NH3, N2O, and CH4 in agriculture. The model used is based on the RAINS (Regional Air pollution INformation and Simulation) model for air pollution in Europe, which includes emissions, abatement options, and atmospheric source-receptor relationships for pollutants contributing to acidification and eutrophication. We used an optimisation model that is largely based on the RAINS model but that also includes emissions of N2O and CH4 from agriculture and technical measures to reduce these emissions. For abatement options for agricultural emissions we estimated side effects on other emissions. The model determines abatement strategies to meet restrictions on emission and/or deposition levels at the least cost. Cost-effective strategies to reduce acidification and eutrophication in Europe were analysed. We found that NH3 abatement may cause an increase in N2O emissions. If total agricultural N2O and CH4 emissions in Europe were not allowed to increase, cost-effective allocation of emission reductions over countries in Europe changed considerably.