ABSTRACT We have previously calculated the intergalactic background light (IBL) as a function of redshift from the Lyman limit in the far-ultraviolet to a wavelength of 5 μm in the near-infrared range, based purely on data from deep galaxy surveys. Here, we use similar methods to determine the mid- and far-infrared IBL from 5 to 850 μm. Our approach enables us to constrain the range of photon densities by determining the uncertainties in observationally determined luminosity densities and spectral gradients. By also including the effect of the 2.7 K cosmic background photons, we determine upper and lower limits on the opacity of the universe to γ-rays up to PeV energies within a 68% confidence band. Our direct results on the IBL are consistent with those from complimentary γ-ray analyses using observations from the Fermi γ-ray space telescope and the H.E.S.S. air Čerenkov telescope. Thus, we find no evidence of previously suggested processes for the modification of γ-ray spectra other than that of absorption by pair production alone.