  Cosmic ray (CR) acceleration at the shock created by the expanding cocoons
around active galactic nuclei (AGNs) is studied. It is shown that above the
energy $10^{18}$ eV the overall energy spectrum of CRs, produced during the AGN
evolution and released in the intergalactic space, has the form $N\propto
\epsilon^{-\gamma}$, with $\gamma\approx 2.6$, which extends up to
$\epsilon_{max}\sim 10^{20}$ eV. It is concluded that cocoons shocks have to be
considered as a main source of extragalactic CRs, which together with Galactic
supernova remnants provide the observed CR spectrum.
