We present the results of a detailed analysis of the host galaxies of powerful active galactic nuclei (AGN) as revealed by deep near-infrared imaging. New K-band images have been obtained of a sample of radio galaxies (RGs) selected to match the radio-loud quasar (RLQ) and radio-quiet quasar (RQQ) samples for which comparable images were presented by Dunlop et al. The images of all three samples have been analysed using detailed 2-dimensional modelling to extract the parameters of the host galaxies. The low nuclear:host ratios displayed by quasars at 2.2 mum, combined with the consistent depth of our images, have enabled us to determine reliably the luminosities, scalelengths and even morphological types of the vast majority of the host galaxies. In fact, tests of the repeatability of our galaxy model fitting with increasing nuclear:host ratio indicate that, with ground-based seeing, it is only at near-infrared wavelengths that the properties of quasar host galaxies can be determined with acceptable reliability. The statistical matching of our samples, combined with consistent application of the same modelling procedure to all sources, has enabled us to perform the most reliable comparison of the host galaxies of RQQs, RLQs and RGs undertaken to date. The picture that emerges is one of relative uniformity, in contrast to the results of several optical studies. We find that the host galaxies of all three classes of AGN are large luminous galaxies with, on average, very similar luminosities. All of the host galaxies have a K-band luminosity L>=L* and all have a half-light radius r_1/2>=10 kpc. In addition, the host galaxies of all three classes of AGN display a mu_1/2-r_1/2 relation identical in both slope and normalization to that displayed by brightest cluster galaxies. With regard to morphological type, we find that essentially all the radio galaxies and RLQ hosts are best described by a de Vaucouleurs r^1/4 law, but that slightly more than half of the RQQs appear to lie in galaxies which are dominated by an exponential disc. Those RQQs which have elliptical hosts are in general more luminous than those which reside in discs. Our results provide clear support for the unification of RLQs and RGs via orientation, and suggest that a significant fraction of the RQQ population may at least be capable of producing powerful radio emission. Finally, our modelling indicates that the majority of the radio galaxies in our sample contain nuclear flux at K in excess of that expected from the best-fitting r^1/4-law model. These unresolved components may simply be indicative of central cusps in the starlight, but their colours and magnitudes appear consistent with dust-reddened quasars. Removal of these nuclear contributions shifts the low-redshift end of the radio galaxy K-z relation faintward by 0.5 mag, a result which has implications for the assessment of cosmological evolution via the K-z relation for radio galaxies.