Gamma-ray bursts are generally considered to be the result of internal shocks generated in an inhomogeneous relativistic outflow that arises from a fireball. In such shocks, the Fermi acceleration of protons is naturally expected to be at least as efficient as that of electrons. We investigate the consequences of proton acceleration in the residual thermal photon field of a fireball, especially those on the emission spectra of photons. In contrast to most other studies, we do not invoke a direct electron acceleration in shock waves. We show that the residual radiation field of the fireball can ignite the photopion production and subsequent cascade, and that the photons emitted in this process further enhance the photon-initiated cascade. We...