We examined the effect of ammonium and temperature on methane production in high rate upflow anaerobic sludge bed reactors treating pig manure supernatant. We operated four reactors at two ammonium concentrations ('low' at 1.9, 'high' at 3.7 g L-1, termed LA and HA reactors, respectively) and at variable temperatures over 358 days. Archaeal and bacterial communities were characterized by Illumina sequencing of 16S rRNA amplicons. Ammonium was a major selective factor for bacterial and archaeal community structure. After ~200 days of adaptation to high ammonium levels, acetate and propionate removal and methane production improved substantially in HA reactors. Aceticlastic Methanosaeta was abundant and positively correlated to methane yield in the HA reactors, whereas Methanosarcina was more abundant in LA reactors. Furthermore, a group of monophyletic OTUs that was related to Thaumarchaeota in phylogenetic analysis was highly abundant in the archaeal communities, particularly in the HA reactors. The most abundant bacterial OTU in LA reactors, representing Syntrophomonadaceae, was also positively correlated to methane yield in the HA reactors, indicating its importance in methane production under ammonia stress. In conclusion, efficient methane production, involving aceticlastic methanogenesis by Methanosaeta took place in the reactors at free ammonia concentrations as high as 1 g L-1.