The dynamical evolution of H II regions with and without stellar motion in dense, structured molecular clouds is studied. Clouds are modeled in hydrostatic equilibrium, with Gaussian central cores and external halos that obey ρ~r-2 and ρ~r-3 power laws. Cloud gravity is included as a time-independent, external force. Stellar velocities of 0, 2, 8, and 12 km s -1 are considered, permitting stars to move from the central core toward the edge of the cloud. Ultracompact H II regions are seen to evolve into extended H II regions as the stars move toward lower density regions. Our main conclusion is that ultracompact H II regions are pressure-confined entities while they remain embedded within dense cores. The confinement comes from either ram or ambient pressures, or a combination of both. The survival of the ultracompact regions depends on the position of the star with respect to the core center, the stellar lifetime, and the crossing time of the cloud core. Stars with velocities less than the cloud dispersion velocity can produce cometary ultracompact H II regions for 2×104 yr or more, in statistical agreement with observations. The sequence ultracompact H II --> compact H II --> extended H II shows a variety of structures induced by various instabilities. Some ultracompact H II regions with a core-halo morphology could be explained by self-blocking effects, when stars overtake and ionize leading, piled-up clumps of neutral gas.