The Fermi Gamma Ray Space Telescope has revealed a diffuse, isotropic γ-ray background at energies ranging from 0.1 GeV to 1 TeV [1] whose astrophysical sources remain uncertain. Previous efforts to understand the origin of this background have been hampered by the lack of physical models capable of predicting the γ-ray emission produced by the many candidate sources, which include star-forming galaxies (SFGs) [2–6], active galactic nuclei (particularly blazars [7–9]), millisecond pulsars[7], and dark matter annihilation [10]. In the absence of predictive models, estimates of the contribution from potential sources have relied on a highly-uncertain process of empirically scaling the emission from a small sample of local, resolved sources by their estimated cosmological abundances. Here we present the first calculation of the contribution of SFGs to the γ-ray background that is based on a physical model for the γ-ray emission produced when cosmic ray ions accelerated in supernova remnants interact with the interstellar medium [11]. We validate the model by showing that it reproduces the γ-ray spectra, source count distribution and far infrared-γ-ray correlation observed for nearby, resolved SFGs. When we apply the model to the observed cosmological SFG population, we recover an excellent match to the γ-ray background from 1 GeV to 1 TeV. Our result shows that SFGs alone can explain the full diffuse γ-ray background over this energy range, and strongly suggests that emission in excess of our model at energies <1 GeV originates from cosmic ray electrons produced in the same galaxies.