Atmospheric ammonia (NH3) has great environmental implications due to its important role in ecosystem and global nitrogen cycle, as well as contribution to secondary particle formation. Here, we report long-term continuous measurements of NH3 at different locations (i.e. urban, industrial and rural) in Shanghai, China, which provide an unprecedented portrait of temporal and spatial characteristics of atmospheric NH3 in and around this megacity. In addition to point emission sources, air masses originated from or that have passed over ammonia rich areas, e.g. rural and industrial sites, increase the observed NH3 concentrations inside the urban area of Shanghai. Remarkable high-frequency NH3 variations were measured at the industrial site, indicating instantaneous nearby industrial emission peaks. Additionally, we observed strong positive exponential correlations between NH4(+)/(NH4(+)+NH3) and sulfate-nitrate-ammonium (SNA) aerosols, PM2.5 mass concentrations, implying a considerable contribution of gas-to-particle conversion of ammonia to SNA aerosol formation. Lower temperature and higher humidity conditions were found to favor the conversion of gaseous ammonia to particle ammonium, particularly in autumn. Although NH3 is currently not included in China's emission control policies of air pollution precursors, our results highlight the urgency and importance of monitoring gaseous ammonia and improving its emission inventory in and around Shanghai.