A high quality , medium-resolution K-band spectrum has been obtained of the ultracompact H ii region G29.96 - 0.02 with the Very Large Telescope ( VLT ) . The slit was positioned along the symmetry axis of the cometary shaped nebula . Besides the spectrum of the embedded ionizing O star , the long-slit observation revealed the rich emission-line spectrum produced by the ionized nebula with sub-arcsec spatial resolution . The nebular spectrum includes Br \gamma , several helium emission lines and a molecular hydrogen line . A detailed analysis is presented of the variation in strength , velocity and width of the nebular emission lines along the slit . The results are consistent with previous observations , but the much better spatial resolution allows a critical evaluation of models explaining the cometary shape of the nebula . Our observations support neither the wind bow shock model nor the champagne flow model . The measured line ratios of the nebular hydrogen and helium lines are compared to predictions from case B recombination-line theory . The results indicate an electron temperature between 6400 and 7500 K , in good agreement with other determinations and the Galactocentric distance of 4.6 kpc . The He ^ { + } /H ^ { + } ratio is practically constant over the slit ; we argue that He is singly ionized throughout the nebula . We review the various observational constraints on the effective temperature of the ionizing star and show that these are in agreement with its K-band spectral type of O5–O6 V .