The origin of the diffuse gamma-ray background (DGRB), the one that remains after subtracting all individual sources from observed gamma-ray sky, is unknown. The DGRB possibly encompasses contributions from different source populations such as star-forming galaxies, starburst galaxies, active galactic nuclei, gamma-ray bursts, or galaxy clusters. Here, we combine cosmological magnetohydrodynamical simulations of clusters of galaxies with the propagation of cosmic rays (CRs) using Monte Carlo simulations, in the redshift range z ≤ 5.0, and show that the integrated gamma-ray flux from clusters can contribute up to 100% of the DGRB flux observed by Fermi-LAT above 100 GeV, for CRs spectral indices α = 1.5 − 2.5 and energy cutoffs $${E}_{\max }=1{0}^{16}-1{0}^{17}$$
E
max
=
1
0
16
−
1
0
17
eV. The flux is dominated by clusters with masses 1013 ≲ M/M⊙ ≲ 1015 and redshift z ≲ 0.3. Our results also predict the potential observation of high-energy gamma rays from clusters by experiments like the High Altitude Water Cherenkov (HAWC), the Large High Altitude Air Shower Observatory (LHAASO), and potentially the upcoming Cherenkov Telescope Array (CTA).