We have observed the (4,4) and (5,5) inversion transitions of ammonia towards 16 ultracompact HII regions, known to be strong NH3(2,2) emitters. 15 of these were detected in the (4,4) line and 10 were also observed and detected in the (5,5) transition. Our results indicate that emission from hot molecular gas is the rule rather than the exception in such regions. Combining our observations with earlier measurements of the (1,1) and (2,2) lines, we find that the inferred level populations can be fit with a single rotational temperature: only G10.47 +/- 0.03A and G31.41 + 0.31 are clearly inconsistent with a single component model. Towards these latter two sources, we detect the hyperfine satellites of the (4,4) and (5,5) transitions and derive line optical depths greater than 100. This suggests the presence of very compact high density regions with ammonia column densities as high as 10(19) cm-2 and temperatures of order 200 K. We also report the detection of the first maser in a metastable transition of para-ammonia (NH3(5,5)) toward G9.62 + 0.19 and absorption in NH3(5,5) towards G45.47 + 0.05; the latter is discussed in detail. Finally, serendipitous detections of the H92-gamma recombination line are presented.