Context : Nitrogen chemistry in protoplanetary disks and the freeze-out on dust particles is key to understand the formation of nitrogen bearing species in early solar system analogs . In dense cores , 10 % to 20 % of the nitrogen reservoir is locked up in ices like NH _ { 3 } , NH _ { 4 } ^ { + } and OCN ^ { - } . So far , ammonia has not been detected beyond the snowline in protoplanetary disks . Aims : We aim to find gas-phase ammonia in a protoplanetary disk and characterize its abundance with respect to water vapor . Methods : Using HIFI on the Herschel Space Observatory we detect , for the first time , the ground-state rotational emission of ortho-NH _ { 3 } in a protoplanetary disk , around TW Hya . We use detailed models of the disk ’ s physical structure and the chemistry of ammonia and water to infer the amounts of gas-phase molecules of these species . We explore two radial distributions ( extended across the disk and confined to < 60 au like the millimeter-sized grains ) and two vertical distributions ( near the midplane and at intermediate heights above the midplane , where water is expected to photodesorb off icy grains ) to describe the ( unknown ) location of the molecules . These distributions capture the effects of radial drift and vertical settling of ice-covered grains . Results : The NH _ { 3 } 1 _ { 0 } – 0 _ { 0 } line is detected simultaneously with H _ { 2 } O 1 _ { 10 } – 1 _ { 01 } at an antenna temperature of 15.3 mK in the Herschel beam ; the same spectrum also contains the N _ { 2 } H ^ { + } 6–5 line with a strength of 18.1 mK . We use physical-chemical models to reproduce the fluxes with assuming that water and ammonia are co-spatial . We infer ammonia gas-phase masses of 0.7-11.0 \times 10 ^ { 21 } g , depending on the adopted spatial distribution , in line with previous literature estimates . For water , we infer gas-phase masses of 0.2-16.0 \times 10 ^ { 22 } g , improving upon earlier literature estimates This corresponds to NH _ { 3 } /H _ { 2 } O abundance ratios of 7 % -84 % , assuming that water and ammonia are co-located . The inferred N _ { 2 } H ^ { + } gas mass of 4.9 \times 10 ^ { 21 } g agrees well with earlier literature estimates based on lower excitation transitions . This masses correspond to a disk-averaged abundances of 0.2–17.0 \times 10 ^ { -11 } , 0.1–9.0 \times 10 ^ { -10 } and 7.6 \times 10 ^ { -11 } for NH _ { 3 } , H _ { 2 } O and N _ { 2 } H ^ { + } respectively . Conclusions : Only in the most compact and settled adopted configuration is the inferred NH _ { 3 } /H _ { 2 } O consistent with interstellar ices and solar system bodies of \sim 5 % –10 % ; all other spatial distributions require addition gas-phase NH _ { 3 } production mechanisms . Volatile release in the midplane may occur via collisions between icy bodies if the available surface for subsequent freeze-out is significantly reduced , e.g. , through growth of small grains into pebbles or larger .