Analysis of the complete oxygen isotopic composition (O-16, O-17, O-18) Of tropospheric N2O from various northern hemispheric locations reveals a mass independent anomaly with a O-17 excess of Delta O-17=1.0+/-0.2 parts per thousand at delta O-18=20.7+/-0.3 parts per thousand. So far, the origin of this intriguing isotope signature has remained elusive. New laboratory experiments demonstrate that the fractionation during UV photolysis of N2O, which causes N-15 and O-18 enrichments in the stratosphere, is strictly mass dependent (Delta O-17=0). To explain the isotope anomaly in atmospheric N2O, we propose a chemical mechanism for heavy oxygen transfer from O-3 to N2O. In a first step, the NOx-O-3 photochemical interaction leads to the formation of NO2 with significant excess O-17. In a second step, the heavy oxygen anomaly is transferred to N2O via the reaction NO2+NH2-->N2O+H2O, as part of the gas phase degradation of ammonia. This small but significant N2O source is of the right magnitude to explain the tropospheric observations.