Аннотация:It is well known that if the ultra-high energy cosmic rays (UHECRs, $E>10^{20}$~eV) were protons then their acceleration sites should possess some extreme properties, including gigantic luminosity. As no stationary sources with such properties are known in the local ($D<200$~Mpc) neighborhood of the Milky Way, it is highly likely that the UHECR acceleration takes place in some transient flares. In this paper we investigate scenario where the UHECRs are produced in strong AGN flares. Using more than 7 years of the Fermi-LAT data and gamma-ray luminosity as a proxy for the bolometric luminosity, we select candidate flares and, using correlation between jet kinetic luminosity and its bolometric luminosity, obtain local kinetic emissivity of giant AGN flares: $\mathcal{L}\sim1.1\times10^{45}\mathrm{erg~Mpc^{-3}~{yr^{-1}}}$. This value is about an order of magnitude larger than the emissivity in the UHECRs, thus making this scenario feasible, if the UHECR escape spectrum is rather hard and/or narrow. This shape of spectrum is predicted in a number of present models of strong relativistic collisionless shocks. Also the scenario of acceleration in AGN flares can accommodate constraints coming from the observed arrival distribution of UHECRs.