  It is shown that an ultrarelativistic shock with the Lorentz factor of order
of tens or higher propagating in a moderately dense interstellar medium
(density above $\sim 1000 $ cm$^{-3}$) undergoes a fast dramatic transformation
into a highly radiative state. The process leading to this phenomenon resembles
the first order Fermi acceleration with the difference that the energy is
transported across the shock front by photons rather than protons. The
reflection of the energy flux crossing the shock front in both directions is
due to photon-photon pair production and Compton scattering. Such mechanism
initiates a runaway nonlinear pair cascade fed directly by the kinetic energy
of the shock. Eventually the cascade feeds back the fluid dynamics, converting
the sharp shock front into a smooth velocity gradient and the runaway evolution
changes to a quasi-steady state regime. This effect has been studied
numerically using the nonlinear Large Particle Monte-Carlo code for the
electromagnetic component and a simplified hydrodynamic description of the
fluid. The most interesting application of the effect is the phenomenon of
gamma-ray bursts where it explains a high radiative efficiencyand gives a
perspective to explain spectra of GRBs and their time variability. The results
predict a phenomenon of ``GeV bursts'' which arise if the density of the
external medium is not sufficiently high to provide a large compactness.
