We discuss the production of cosmological gamma-ray bursts intense enough to be detected at cosmological distances. Events such as the coalescence of compact binaries can create sufficient energy on time scales much less than 1 s. A short ''primary'' burst is expected when the resultant fireball becomes optically thin, but this may be weak because the bulk of the radiative energy has been converted into kinetic energy while still trapped within the fireball. But when this expanding material impacts on an external medium, its bulk kinetic energy can be rerandomized. If the expansion is very relativistic (with Lorentz factors GAMMA greater than or similar to 10(2)-10(3)), this occurs after a time that, in the observer frame, is only of the order of seconds. Moreover the rerandomized energy can then be efficiently radiated, yielding a nonthermal burst that is much stronger than the primary burst. This mechanism can operate on any scenario when greater than or similar to 0.1 % of a solar rest mass is converted into a fireball, or less if the fireball is beamed. The requirements on the composition of the fireball itself are less stringent than for other interpretations of cosmological gamma-ray bursts. Moreover, our model suggests that the spectra and time structure of the bursts may depend in interesting ways on the environment in which the energy-generating event occurs.