A model is proposed for the origin of cosmic rays (CRs) from similar to10(14) eV/nucleon to the highest energies (greater than or similar to10(20) eV). GRBs are assumed to inject CR protons and ions into the interstellar medium of star-forming galaxies-including the Milky Way-with a power-law spectrum extending to a maximum energy similar to10(20) eV. The CR spectrum near the knee is fit with CRs trapped in the Galactic halo that were accelerated and injected by an earlier Galactic GRB. These CRs diffuse in the disk and halo of the Galaxy due to gyroresonant pitch-angle scattering with MHD turbulence in the Galaxy's magnetic field. The preliminary (2001) KASCADE data through the knee of the CR spectrum are fit by a model with energy-dependent propagation of CR ions from a single Galactic GRB. Ultra-high energy CRs (UHECRs), with energies above the ankle energy at greater than or similar to3 x 10(18) eV, are assumed to propagate rectilinearly with their spectrum modified by photo-pion, photo-pair, and expansion losses. We fit the measured UHECR spectrum assuming comoving luminosity densities of GRB sources consistent with possible star formation rate histories of the Universe. For power-law CR proton injection spectra with injection number index p greater than or similar to 2 and low- and high-energy cutoffs, normalization to the local time- and space-averaged GRB luminosity density implies that if this model is correct, the nonthermal content in GRB blast waves is hadronically dominated by a factor approximate to60-200, limited in its upper value by energetic and spectral considerations. Calculations show that 100 TeV to 100 PeV neutrinos could be detected several times per year from all GRBs with kilometer-scale neutrino detectors such as IceCube, for GRB blast-wave Doppler factors delta less than or similar to 200. GLAST measurements of gamma-ray components and cutoffs will constrain the product of the nonthermal baryon loading and radiative efficiency, limit the Doppler factor, and test this scenario. (C) 2004 Elsevier B.V. All rights reserved.