We predict and experimentally observe the enhancement by three orders of magnitude of phase mismatched second and
third harmonic generation in a GaAs cavity at 650 and 433 nm, respectively, well above the absorption edge. Phase
locking between the pump and the harmonics changes the effective dispersion of the medium and inhibits absorption.
Despite hostile conditions the harmonics resonate inside the cavity and become amplified leading to relatively large
conversion efficiencies. Field localization thus plays a pivotal role despite the presence of absorption, and ushers in a
new class of semiconductor-based devices in the visible and UV ranges.